Commit graph

49 commits

Author SHA1 Message Date
redmatrix
be0459a98b convert the abook fields 2015-06-14 21:08:00 -07:00
friendica
c98de44528 more logging for onepoll 2015-03-31 20:01:37 -07:00
friendica
0596097f86 provide storage for directory based reputation in the xlink table by setting xlink_static = 1, so that xlink_static = 0 is traditional poco linkages 2015-01-26 19:13:06 -08:00
Habeas Codice
1a5a5c7edb PostgreSQL support initial commit
There were 11 main types of changes:
- UPDATE's and DELETE's sometimes had LIMIT 1 at the end of them. This is not only non-compliant but
it would certainly not do what whoever wrote it thought it would. It is likely this mistake was just
copied from Friendica. All of these instances, the LIMIT 1 was simply removed.
- Bitwise operations (and even some non-zero int checks) erroneously rely on MySQL implicit
integer-boolean conversion in the WHERE clauses. This is non-compliant (and bad programming practice
to boot). Proper explicit boolean conversions were added. New queries should use proper conventions.
- MySQL has a different operator for bitwise XOR than postgres. Rather than add yet another dba_
func, I converted them to "& ~" ("AND NOT") when turning off, and "|" ("OR") when turning on. There
were no true toggles (XOR). New queries should refrain from using XOR when not necessary.
- There are several fields which the schema has marked as NOT NULL, but the inserts don't specify
them. The reason this works is because mysql totally ignores the constraint and adds an empty text
default automatically. Again, non-compliant, obviously. In these cases a default of empty text was
added.
- Several statements rely on a non-standard MySQL feature
(http://dev.mysql.com/doc/refman/5.5/en/group-by-handling.html). These queries can all be rewritten
to be standards compliant. Interestingly enough, the newly rewritten standards compliant queries run
a zillion times faster, even on MySQL.
- A couple of function/operator name translations were needed (RAND/RANDOM, GROUP_CONCAT/STRING_AGG,
UTC_NOW, REGEXP/~, ^/#) -- assist functions added in the dba_
- INTERVALs: postgres requires quotes around the value, mysql requires that there are not quotes
around the value -- assist functions added in the dba_
- NULL_DATE's -- Postgres does not allow the invalid date '0000-00-00 00:00:00' (there is no such
thing as year 0 or month 0 or day 0). We use '0001-01-01 00:00:00' for postgres. Conversions are
handled in Zot/item packets automagically by quoting all dates with dbescdate().
- char(##) specifications in the schema creates fields with blank spaces that aren't trimmed in the
code. MySQL apparently treats char(##) as varchar(##), again, non-compliant. Since postgres works
better with text fields anyway, this ball of bugs was simply side-stepped by using 'text' datatype
for all text fields in the postgres schema. varchar was used in a couple of places where it actually
seemed appropriate (size constraint), but without rigorously vetting that all of the PHP code
actually validates data, new bugs might come out from under the rug.
- postgres doesn't store nul bytes and a few other non-printables in text fields, even when quoted.
bytea fields were used when storing binary data (photo.data, attach.data). A new dbescbin() function
was added to handle this transparently.
- postgres does not support LIMIT #,# syntax. All databases support LIMIT # OFFSET # syntax.
Statements were updated to be standard.

These changes require corresponding changes in the coding standards. Please review those before
adding any code going forward.

Still on my TODO list:
- remove quotes from non-reserved identifiers and make reserved identifiers use dba func for quoting
- Rewrite search queries for better results (both MySQL and Postgres)
2014-11-13 12:21:58 -08:00
friendica
28a35261db What this checkin does is catch the case where a comment arrived and there's a missing top-level post to match it with. So we'll send a request back to the sender that you've never seen this thread and please send a fresh copy of the entire conversation to date. We could soon have posts in the matrix from different platforms from days gone by, which have been migrated into the modern world. We'll be polite and not deliver these to everybody. However, if someone comments on one of these antique threads we wouldn't be able to see it in our own matrix because we won't have a copy of the parent post. So this rectifies that situation. Be aware that item deletion may need to change to keep "hard deleted" items indefinitely so that they don't keep coming back. We'll have to null out the important data of the former item to accomplish the deletion aspect. 2014-10-30 19:15:03 -07:00
friendica
87a6f25769 try to sort out walltowall translation for diaspora recipients 2014-09-19 02:22:24 -07:00
friendica
c6d07feff5 This is long overdue - use a symblic constant NULL_DATE instead of the easily mis-typed sequence '0000-00-00 00:00:00' 2014-09-08 20:35:15 -07:00
friendica
2a37d99958 get out the sunnies 2014-08-31 22:15:00 -07:00
friendica
d57c57ad59 onepoll: don't poll archived, blocked, or ignored connections 2014-08-24 05:26:00 -07:00
friendica
86d60f572f change flags for one-way connections from hidden to unconnected so we can still use hidden for - well hiding connections 2014-03-04 14:35:42 -08:00
friendica
13538cdd21 pull in some posts when we first connect with a new channel (if allowed to) - if not allowed to, do it if that condition changes 2013-11-17 19:22:24 -08:00
friendica
06e0272db8 populate some posts when somebody is granted "read stream" permission 2013-11-17 16:50:32 -08:00
friendica
85e291f535 figure out why poller isn't picking up old posts which failed to deliver 2013-08-29 18:17:15 -07:00
friendica
ea3940c4b0 start formatting for Doxygen 2013-02-25 17:09:40 -08:00
friendica
e270bd3874 mark for death implemented 2013-01-29 19:28:19 -08:00
friendica
f591526ebc missing permission settings 2013-01-29 18:01:33 -08:00
friendica
b2d03eb55c convert mod/follow to associative json and add more logging for when things go wrong 2013-01-29 02:05:21 -08:00
friendica
318d75a86a poco debugging cont. 2013-01-25 15:36:18 -08:00
friendica
fc8225be8d here's another reason the social graph isn't updating 2013-01-24 21:17:59 -08:00
friendica
4f7f547190 why oh why is poco_load not getting called? oh - that's why. 2013-01-24 14:31:57 -08:00
friendica
d06c21dc39 some poco fixes 2013-01-22 20:48:03 -08:00
friendica
53cd7a64b6 json_decode param missing 2013-01-03 19:35:42 -08:00
friendica
bec7d9f483 temporary feed import/export (public only for the moment) until this is integrated with remote permissions 2013-01-03 19:34:04 -08:00
friendica
c266f0724b another typo 2013-01-02 01:47:06 -08:00
friendica
50d1cb2e3a start building social graph 2013-01-01 23:56:27 -08:00
friendica
ba0876d011 update timestamps on successful poll 2012-12-30 23:55:57 -08:00
friendica
2d113f0c87 refresh now works on poller runs 2012-12-30 23:51:39 -08:00
friendica
83db4abaab fixes 2012-12-30 22:56:52 -08:00
friendica
abc271a0e7 more progress on onepoll 2012-12-30 22:41:53 -08:00
friendica
14fb503800 progress on poller 2012-12-30 16:14:29 -08:00
friendica
c6b8ab534f fixed several little nit bugs that cropped up during deployment 2012-12-06 00:03:24 -08:00
friendica
dd428cf4fc rm pidfile stuff since we won't need poller locking 2012-11-29 19:52:10 -08:00
friendica
e3c2e58979 "profile url" e.g. the wall/stream is now "channel url". "Profile URL" goes to the profile details. 2012-10-29 17:14:02 -07:00
friendica
80bd128425 more DB cleanup 2012-08-30 18:47:07 -07:00
friendica
d92a4a686d eliminate the obsolete "last-child" indicator 2012-07-18 17:08:03 -07:00
Zach Prezkuta
fa7e803f73 fix check for parent of StatusNet API post 2012-06-25 08:26:12 -06:00
friendica
4faf0e609f rev update 2012-06-16 03:35:45 -07:00
friendica
ff45e11284 redundant log entry 2012-06-14 17:55:30 -07:00
friendica
2efee75557 also mark for death if there isn't any xml to be found 2012-06-14 17:38:39 -07:00
friendica
267681844d poll even if contact hasn't responded recently, so we can update the termination status 2012-06-14 17:27:07 -07:00
friendica
be090cc851 better handling of dead contacts 2012-06-14 16:56:46 -07:00
friendica
09f74be14c variable confusion in poller, don't allow negative page offsets 2012-06-11 17:24:16 -07:00
friendica
da7773a259 ostatus hub subscription issues 2012-06-07 19:53:39 -07:00
friendica
8a4e3cc370 don't throw "did not contain xml" error if it's a valid rss that doesn't have the <?xml declaration 2012-05-07 16:51:09 -07:00
friendica
189a31e628 If a contact has had delivery issues in the last 15 minutes, send new posts straight to the queue
and don't even try to connect. Also defer polling for stuck contacts. Should reduce the number of
stuck processes trying to connect with dead or dying servers significantly.
2012-05-07 15:54:49 -07:00
friendica
584ac68ae4 adding zrl support to social graphs 2012-05-01 01:16:47 -07:00
friendica
4ff2e9a103 a few more continues that should be returns 2012-04-28 16:54:33 -07:00
friendica
44700b914d poller refactor: continue not valid in this context 2012-04-28 04:20:38 -07:00
friendica
f163aed66d break up poller into separate processes 2012-04-27 23:17:40 -07:00