Commit graph

33 commits

Author SHA1 Message Date
friendica
b428fdf66e abstract poco into a single function in socgraph so we can provide different wrappers for it providing slightly different functionality. 2015-01-25 16:27:09 -08:00
friendica
ec4d3a2349 fix to poco chatrooms 2015-01-15 20:56:55 -08:00
friendica
43254029ad errors in mod_poco 2015-01-15 20:43:53 -08:00
friendica
1c9299ed42 more backend work on poco rating 2015-01-15 14:05:18 -08:00
Habeas Codice
e61dbf722d implicit type conversion 2014-11-17 16:49:17 -08:00
Habeas Codice
d0e0a8fb27 implicit type conversion 2014-11-17 16:37:47 -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
ad58fe893d fix poco network 2014-09-04 19:34:27 -07:00
friendica
e7e97e578b put bookmarked chatrooms into poco 2014-02-25 19:48:13 -08:00
friendica
e754845c80 add rating support to poco 2013-02-15 22:34:01 -08:00
friendica
e270bd3874 mark for death implemented 2013-01-29 19:28:19 -08:00
friendica
95415bff69 delete item should now mostly work 2013-01-28 19:24:36 -08:00
friendica
89c6fc939d Someday the social graph will work, but alas not today. Add more debugging. 2013-01-28 18:07:31 -08:00
friendica
1dbd160392 suppose I should do this right. 2013-01-27 19:05:51 -08:00
friendica
a627cdcf7d still no social graph - oh maybe it's because the observer hash isn't valid and everybody's permission is denied. Well it's just another bug, but not the real bug. We're connecting as anonymous so that shouldn't make a difference. 2013-01-27 19:02:03 -08:00
friendica
d06c21dc39 some poco fixes 2013-01-22 20:48:03 -08:00
friendica
a8e16c48b1 fix poco acct: url 2012-12-30 03:15:58 -08:00
friendica
061a279ed3 make poco work again 2012-11-29 19:43:53 -08:00
friendica
8e8482355b more heavy lifting 2012-10-23 17:14:50 -07:00
friendica
eac29badb2 start on contacts/profiles 2012-08-30 18:17:38 -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
9b6e91086b make 'PHP "register_argc_argv"' easier to translate, may require fix for po2php 2012-04-05 02:15:03 -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
friendica
3aab1c7140 typo 2011-12-18 00:22:44 -08:00
friendica
b0718c4f05 typo 2011-12-18 00:21:01 -08:00
friendica
978717a247 add webfinger to poco, if present 2011-12-18 00:14:34 -08:00
friendica
c8d5274cee data structures to support hidden friends 2011-12-05 02:16:59 -08:00
friendica
f4e1135f79 poco addition to provide a "suggestme" for new members 2011-11-28 15:11:59 -08:00
Friendika
d4644d7339 name change continued, social graph tools and stuctures, fix for spanish province name 2011-10-31 20:39:04 -07:00
Friendika
ea0ab6fbac poco should now be spec compliant 2011-10-27 04:38:33 -07:00
Friendika
abe96155b4 hmmm - why won't poco xml work 2011-10-27 01:54:52 -07:00
Friendika
31502207bd more poco spec compliance 2011-10-27 00:57:19 -07:00
Friendika
faa078b83f basic portable contacts http://portablecontacts.net/draft-spec.html no filter/sort, or xml at the moment 2011-10-26 20:09:03 -07:00