Commit graph

32 commits

Author SHA1 Message Date
friendica
39459c2d65 undo these bits of trinidad - we're going to do things differently 2015-01-05 18:22:15 -08:00
friendica
5cfe051139 initial trinidad checkin 2014-12-29 23:48:04 -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
87a6f25769 try to sort out walltowall translation for diaspora recipients 2014-09-19 02:22:24 -07:00
friendica
89b65e554c reduce log level of inbound d* posts until we get through some of the more serious federation issues 2014-09-09 20:32:03 -07:00
friendica
05515e3b10 D* receive endpoint is receive/users/$guid - where $guid is really the channel_guid, not the channel_hash. We'll allow this to be truncated for older D* sites or those that can't process our 64 character guids. 2014-08-21 20:42:55 -07:00
friendica
94ed44e76e change default invitation message 2014-08-11 19:38:04 -07:00
friendica
f2244539da nothing going on here. nothing to see. move along. 2014-08-10 22:19:08 -07:00
friendica
d683df17bd Removing connectors we won't be needing - this is probably going to break some shit. 2012-07-18 04:49:15 -07:00
Alexander Kampmann
355c42cb30 Merge branch 'master' of https://github.com/friendica/friendica
Conflicts:
	include/config.php
	update.php
2012-04-05 13:39:15 +02:00
friendica
b45327b856 let's catch d* disabled at a higher level and not waste any resources on it. 2012-04-04 20:45:48 -07:00
friendica
8aa2552372 add remove_user hook (it looks like dreamhost changed all my file permissions, this will make a nasty commit) 2012-01-18 16:21:30 -08:00
Friendika
2aef98f71d cripple account when expired 2011-09-19 01:17:12 -07:00
Friendika
5c0e135fe9 diaspora protocol changes 2011-09-14 19:33:42 -07:00
Friendika
2aa23843e4 D* queue 2011-08-24 01:21:24 -07:00
Friendika
56d64316f4 diaspora photos ? 2011-08-23 18:17:35 -07:00
Friendika
395faae0b2 double url encode diaspora communications 2011-08-19 02:24:30 -07:00
Friendika
673e114bbd D* like and start of relay code 2011-08-16 22:31:14 -07:00
Friendika
c7197b99f9 refactor the diaspora contact logic 2011-08-15 23:19:17 -07:00
Friendika
44918e2736 turn diaspora posts into x-www-form-urlencoded 2011-08-15 17:14:51 -07:00
Friendika
5d6155a968 fixes share from diaspora 2011-08-15 05:27:24 -07:00
Friendika
aefc6209a3 improved diaspora discovery 2011-08-12 03:01:11 -07:00
Friendika
72873cd827 diaspora function dispatcher 2011-08-10 05:10:48 -07:00
Friendika
1bfe1283aa crypto stuff 2011-08-09 18:55:46 -07:00
Friendika
70017ebb8c diaspora encrypt+decrypt working !! 2011-08-09 02:53:51 -07:00
Friendika
48ffa880f0 cleanup 2011-08-07 16:15:54 -07:00
Friendika
5a5a7bfc4c fallback sha256 openssl_verify code for php releases prior to 5.3 2011-08-05 05:37:42 -07:00
Friendika
6eec04b09c updates to Diaspora decrypt/verify from recent testing 2011-08-05 01:34:32 -07:00
Friendika
01703f3be6 get_diaspora_key() 2011-07-30 00:51:59 -07:00
Friendika
a61ec584d6 basic diaspora decryption 2011-07-30 00:31:00 -07:00
Friendika
1d7d4bf8c6 wrong path for salmon verify 2011-07-20 23:14:43 -07:00
Friendika
e2f22a1827 diaspora salmon endpoint (decryption not yet provided) 2011-07-19 21:23:47 -07:00