Commit graph

46 commits

Author SHA1 Message Date
Stefan Parviainen
c1b8608940 Switch to a better datetime picker widget 2014-11-16 13:56:45 +01:00
Habeas Codice
ac27db22c1 Merge remote-tracking branch 'upstream/master'
Conflicts:
	boot.php
	include/dba/dba_driver.php
	include/diaspora.php
	include/follow.php
	include/session.php
	include/zot.php
	mod/photos.php
	mod/ping.php
2014-11-13 13:06:31 -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
325b269b22 the code is a bit crufty, but this should fix issue #687 2014-11-11 01:05:29 -08:00
Stefan Parviainen
d9f2944565 Fix problem with default birth date 2014-10-31 16:09:48 +01:00
Stefan Parviainen
a6c4ae186e Don't display date format, it's already in the placeholder text 2014-10-19 11:09:51 +02:00
Stefan Parviainen
519ef48500 Changes in the datetimesel api, prevent user from picking event end date earlier than start date 2014-10-19 10:47:42 +02:00
Stefan Parviainen
7c4f55af9f Oops, forgot one file 2014-10-18 22:17:49 +02: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
737d3f5836 don't add a birthday event if the birthday channel doesn't have permission to send you posts. 2014-06-03 19:25:59 -07:00
friendica
2386bc4d00 bring back birthdays 2014-06-02 17:49:19 -07:00
friendica
6c321be03c reorganise a few included functions - notably identity related functions 2013-12-03 15:35:13 -08:00
friendica
ea3940c4b0 start formatting for Doxygen 2013-02-25 17:09:40 -08:00
Mike Macgirvin
672da80282 progress however tedious 2012-10-23 20:59:20 +11:00
friendica
f83a504da1 more work on json notifications, now working except for notify popup 2012-07-15 21:06:07 -07:00
friendica
71afdf3d9c gracefully recover from datetime constructor issues 2012-07-11 16:20:17 -07:00
friendica
d32d0e2154 typos 2012-06-25 21:39:07 -07:00
friendica
78ede4744f add event titles to discovered birthday events 2012-06-25 21:37:38 -07:00
Erkan Yilmaz
e8e1de3603 add missing bracket 2012-06-13 20:41:53 +02:00
friendica
b6ff71acaa survive bad/un-parseable input to datetime_convert 2012-06-12 02:06:29 -07:00
friendica
608d424b0b "howlong" added to marital status. 2012-06-02 02:30:26 -07:00
friendica
c1e2596807 more sane defaults datetime_convert 2012-04-08 18:09:21 -07:00
friendica
129130b0f7 fix empty string timezone 2012-04-08 18:01:49 -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
3e85c1d330 make 'x minutes ago' fully translateable with argument ordering. string update. 2012-02-12 17:15:09 -08: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
Fabio Comuni
f35109827b datetime: new field_timezone() function, new template field_select_raw.tpl
returns a timezone select like select_timezone() but using template field_select_raw.tpl.
field_select_raw get options html as forth argument, instead of array value=>label like field_select
2012-01-02 20:09:25 +01:00
Friendika
af6ab38100 diaspora birthday notifications 2011-10-14 00:20:37 -07:00
Friendika
454ff3c7f0 configurable format for date input selectors 2011-07-25 20:59:25 -07:00
Fabio Comuni
f4a1820110 re-added last item date in admin user page. relative_date return 'never' if null is passed 2011-06-29 16:06:32 +02:00
Friendika
baead9f4c8 very minor nit - if $abs is false, return before trying to use false in a numeric calculation
also return 'never' if we have an uninitialised date
2011-06-29 03:54:29 -07:00
Fabio Comuni
1e307e9869 Fix bug #98, add "never" to relative_date(), fix batch operations 2011-06-29 12:05:09 +02:00
Friendika
fcb4316c29 tinymce for event fields 2011-06-06 21:49:07 -07:00
Friendika
9f51233451 event listings 2011-06-06 20:17:36 -07:00
Friendika
452245d988 more events framework 2011-06-06 19:59:20 -07:00
Friendika
365ff94137 push directory on register - if permitted 2011-02-23 01:37:15 -08:00
Friendika
a5b80e5d56 add some calendaring functions 2011-02-22 20:08:15 -08:00
Mike Macgirvin
e25e40f1ef i18n string extraction util 2010-09-29 18:11:23 -07:00
Mike Macgirvin
4d8e8de0bf clarify birthday doco, Facebook really screwed this one up. 2010-09-27 00:46:29 -07:00
Mike Macgirvin
627c65b49f doco 2010-09-27 00:38:26 -07:00
Mike Macgirvin
ffb1997902 mistpark 2.0 infrasturcture lands 2010-09-08 20:14:17 -07:00
Mike Macgirvin
35e29e10e6 installer changes, pe sync 2010-08-15 21:49:29 -07:00
Mike Macgirvin
c34189c033 fix birthday 2010-07-11 04:54:39 -07:00
Mike Macgirvin
44b1984136 profile additions 2010-07-10 07:09:57 -07:00
Mike Macgirvin
cb54cda174 more directory work 2010-07-09 22:47:32 -07:00
Mike Macgirvin
6348e70daa Initial checkin 2010-07-01 16:48:07 -07:00