Commit Graph

72 Commits

Author SHA1 Message Date
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 1b3196862d issue #588 can't add feeds to collections using connedit page group sidebar widget 2014-09-11 02:19:21 -07:00
friendica 5ad76c4d0c the sending side of clone syncing of collection/privacy_group information. The receiving side is not yet implemented. 2014-07-14 02:37:41 -07:00
marijus f62ec4132e let oneself be added to a collection in exchange for deleted contacts 2014-02-07 21:28:39 +01:00
marijus eb868f6df8 make network tabs regard selected group (collection) and vice versa 2014-01-22 17:18:40 +01:00
friendica 1a42580ad4 remove a couple of mysql reserved words from being used as table or row names. For this round we're getting 'group' and 'desc'. Warning: potentially destabilising as this touches a lot of code. 2013-12-22 18:37:39 -08:00
friendica 2c0fbc508e comanchify connedit, group 2013-12-19 23:56:37 -08:00
friendica d32e05fb5e starting on the journey to comanche everywhere - beginning with widget conversions. There are approximately 20 which need to be wrapped for accessibility to comanche. 2013-12-08 16:04:28 -08:00
friendica 3e0ac769aa white screen 2013-11-21 17:23:14 -08:00
friendica 5b48ab772b fix private group delivery 2013-11-05 14:26:31 -08:00
friendica 4cda133e89 Add public visibility setting to privacy groups (collections). This doesn't yet make them visible, but allows them to be visible (like a Cc: instead of a Bcc:) 2013-08-07 17:51:10 -07:00
friendica 281d73b03a issue #55 (number 2) 2013-05-28 16:32:31 -07:00
friendica b33c15d045 members_of_group() output not entirely correct 2013-05-02 20:51:58 -07:00
friendica 810a60b912 add new connections to default group (if any) 2013-03-27 19:35:34 -07:00
friendica 8d442e6fc1 fix timeago (again), webfinger new spec implemented, some theme work 2013-03-04 20:58:39 -08:00
friendica ea3940c4b0 start formatting for Doxygen 2013-02-25 17:09:40 -08:00
friendica ce95b1f68c clean up some sql errors from the logs 2013-02-08 16:26:00 -08:00
friendica d43591fb0f fixed contactgroup editor 2013-01-22 20:13:20 -08:00
Olaf Conradi acbf822bbd Stringify groups before imploding 2012-12-25 16:01:32 +01:00
friendica 37974e5288 db query looping without bounds if group table wasn't manually updated to add the 'hash' column. 2012-12-14 15:08:55 -08:00
friendica 8f864ebd19 Fixing the acl widget is going to be hard. Here's a start. 2012-12-06 19:18:38 -08:00
friendica f7ff2de132 add pending check on group queries 2012-11-29 23:06:03 -08:00
friendica 160258fd5d make the visual group editor work again in the new world 2012-11-14 20:55:05 -08:00
friendica fcb89c6311 groups now take xchans, so you can have groups containing channels that you aren't connected with 2012-11-14 18:18:28 -08:00
friendica 2fa93655c4 a lot more changes of terminology 2012-11-03 02:34:12 -07:00
friendica e29618ee0d contact group is now 'channel group' 2012-10-27 03:54:44 -07:00
friendica 846a9813b2 here's where the heavy lifting begins - everything is likely to be broken for quite some time as we add location and db independence to items and conversations and work through the rest of the permissions and how to federate the buggers. 2012-10-01 18:02:11 -07:00
friendica b0f1d03a8a convert all network search params to get requests (no url path args) 2012-07-23 17:35:58 -07:00
friendica a20a637727 merge upstream, slider work, refactor ping module, language selection work 2012-07-13 07:09:29 -07:00
friendica 34b79b4f2b theming for default group selector 2012-05-18 01:38:11 -07:00
friendica 7b0ded3f14 more private forums, default privacy group for new contacts 2012-05-17 22:44:52 -07:00
friendica 3c4e6d3461 bug #369 - show contacts who are not in any groups 2012-04-12 23:06:41 -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 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
friendica ac3df5fece dynamic group edit buttons 2011-12-01 16:33:53 -08:00
friendica 29b5d398fd everybody group gets id 0 2011-11-30 23:01:42 -08:00
friendica 335c0cddcf diaspora reshared lists rendering as html 2011-11-23 01:44:07 -08:00
Fabio Comuni a86fd26bd8 more work on quattro. remove html from php for groups and saved searches widgets. 2011-11-21 12:34:22 +01:00
Friendika 02f21fb74c some testbubble fixes 2011-11-10 19:53:13 -08:00
Devlon Duthie cb1c6dd1e3 really commiting files this time, still getting the hang of git.
some images added, some classes added to groupidebar, contacts sidebar
notification flags moved out of nav and into banner for testbubble the
testbubble css tweaks
2011-09-25 13:20:19 -05:00
Friendika 3a2bf8ab7c w3c compliance fixes, owner attribution on likes defaulting to local owner, not item creator 2011-09-23 03:12:31 -07:00
Friendika 5899c9f406 bug #157 - allow deleted group to be revived, but warn of side effects 2011-09-18 06:20:18 -07:00
Friendika 1248a561e1 group_public_members sql query typo 2011-09-13 15:26:47 -07:00
Friendika f5c9de19d5 network insecure warnings on feeds 2011-09-09 01:37:46 -07:00
Friendika 481853d2cc saved searches on network page 2011-09-04 17:35:06 -07:00
Friendika e440353013 truncate overflow text on acl selector items (3 themes) 2011-09-04 05:41:11 -07:00
Friendika 3b4da00495 fix it again 2011-08-23 18:28:17 -07:00
Friendika b41592f556 fix group public members 2011-08-23 18:22:15 -07:00
Friendika 56d64316f4 diaspora photos ? 2011-08-23 18:17:35 -07:00
Friendika 684ebd2ed8 enhance random_string, block public email replies 2011-08-10 21:06:35 -07:00