Commit Graph

123 Commits

Author SHA1 Message Date
Kevin Locke
785307ee95 [nextgen-gallery] Fix identifiers quoted as strings
MySQL allows quoting identifiers, such as column names, as strings using
single-quotes in addition to quoting as identifiers using grave accents.
PostgreSQL does not, resulting in errors such as:

Error running :
SELECT DISTINCT wp_ngg_pictures.* , GROUP_CONCAT(CONCAT_WS('@@', meta_key, meta_value)) AS 'extras' FROM `wp_ngg_pictures` LEFT OUTER JOIN `wp_postmeta` ON `wp_postmeta`.`post_id` = `extras_post_id`  GROUP BY wp_ngg_pictures.pid LIMIT 1
---- converted to ----
SELECT DISTINCT wp_ngg_pictures.* , GROUP_CONCAT(CONCAT_WS('@@', meta_key, meta_value)) AS 'extras' FROM wp_ngg_pictures LEFT OUTER JOIN wp_postmeta ON wp_postmeta.post_id = extras_post_id  GROUP BY wp_ngg_pictures.pid LIMIT 1
----> ERROR:  syntax error at or near "'extras'"
LINE 1: ..._CONCAT(CONCAT_WS('@@', meta_key, meta_value)) AS 'extras' F...
                                                             ^

Fix this by replacing single quotes with grave accents when they occur
after ") AS ".  This strategy obviously has both false-positive and
false-negative issues, but suits the current needs and should be
relatively safe from false-positives.  Proper replacement would require
parsing the SQL.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
49e598f300 [flash-album-gallery] Add tinyint to smallint conversion
The flash-album-gallery plugin defines columns using the tinyint type
without a display width.  Convert this to smallint.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
50c091946c Make data type conversion case-insensitive
Data types are not case-sensitive, and the current data type conversion
assumes that the types are all lower-case.  Although this is currently
the case for most (all?) of the Wordpress core, it is not the case for
all extensions (e.g. nextgen-gallery).  Make data type conversion
case-insensitive.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
67d7129b99 Fix CHANGE COLUMN matching
The current regex for matching ALTER TABLE CHANGE COLUMN does not match
against a statement where there is nothing after the column data type,
resulting in errors such as:

Error running :
ALTER TABLE wp_ngg_pictures CHANGE COLUMN meta_data meta_data LONGTEXT
---- converted to ----
ALTER TABLE wp_ngg_pictures CHANGE COLUMN meta_data meta_data LONGTEXT
----> ERROR:  syntax error at or near "CHANGE"
LINE 1: ALTER TABLE wp_ngg_pictures CHANGE COLUMN meta_data meta_dat...
                                    ^

Fix this by making the space before NOT NULL optional.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
e5353f70d6 Support INSERT IGNORE
MySQL supports the IGNORE modifier on INSERT statements, which ignores
uniqueness errors resulting from the INSERT.  This causes syntax errors
in PostgreSQL such as the following:

Error running :
INSERT IGNORE INTO `wp_options` ( `option_name`, `option_value`, `autoload` ) VALUES ('auto_updater.lock', '1433306517', 'no') /* LOCK */
---- converted to ----
INSERT IGNORE INTO wp_options ( option_name, option_value, autoload ) VALUES ('auto_updater.lock', '1433306517', 'no') /* LOCK */
----> ERROR:  syntax error at or near "IGNORE"
LINE 1: INSERT IGNORE INTO wp_options ( option_name, option_value, a...
               ^

Provide support for INSERT IGNORE using a PostgreSQL DO statement with
an exception handler for uniqueness errors.

This has the drawback that it requires PostgreSQL 9.0 or later, support
for plpgsql, and USAGE privileges for plpgsql for the current user.  But
these are all common, and it allows us to support INSERT IGNORE
statements generically.  If this is later found to be too much of a
problem, it is possible to rewrite the query on a query-specific basis
to an INSERT SELECT statement without a FROM clause.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
6d55670e42 Tighten quoting of ID identifiers
The quoting of identifiers which contain "ID" can match things other
than identifiers, such as strings which contain "ID" and subsequently
"=".  An example of this occurring in practice is:

Error running :
UPDATE `wp_ngg_pictures` SET `pid` = '42', `post_id` = 0, `galleryid` = '3', `filename` = 'img_0683.jpg', `description` = '', `alttext` = 'img_0683', `imagedate` = '2011-02-05 11:52:31', `exclude` = '0', `sortorder` = '0', `meta_data` = 'eyIwIjpmYWxzZSwiYXBlcnR1cmUiOiJGIDUuNiIsImNyZWRpdCI6ZmFsc2UsImNhbWVyYSI6IkNhbm9uIEVPUyBSRUJFTCBUMWkiLCJjYXB0aW9uIjpmYWxzZSwiY3JlYXRlZF90aW1lc3RhbXAiOiJGZWJydWFyeSA1LCAyMDExIDExOjUyIGFtIiwiY29weXJpZ2h0IjpmYWxzZSwiZm9jYWxfbGVuZ3RoIjoiNTUgbW0iLCJpc28iOjQwMCwic2h1dHRlcl9zcGVlZCI6IjFcLzYwIHNlYyIsImZsYXNoIjoiRmlyZWQiLCJ0aXRsZSI6ZmFsc2UsImtleXdvcmRzIjpmYWxzZSwid2lkdGgiOjE2MDAsImhlaWdodCI6MTA2Nywic2F2ZWQiOnRydWUsInRodW1ibmFpbCI6eyJ3aWR0aCI6MTAwLCJoZWlnaHQiOjc1fSwibmdnMGR5bi0weDI1MC0wMGYwdzAxMWMwMTByMTEwZjExMHIwMTB0MDEwIjp7IndpZHRoIjozNzUsImhlaWdodCI6MjUwLCJmaWxlbmFtZSI6ImltZ18wNjgzLmpwZy1uZ2dpZDAyNDItbmdnMGR5bi0weDI1MC0wMGYwdzAxMWMwMTByMTEwZjExMHIwMTB0MDEwLmpwZyIsImdlbmVyYXRlZCI6IjAuNjczMzIxMDAgMTQzMzYyOTQxMiJ9fQ==', `image_slug` = 'img_0683', `extras_post_id` = '310', `updated_at` = '1433629412' WHERE `pid` = '42'
---- converted to ----
UPDATE wp_ngg_pictures SET pid = '42', post_id = 0, galleryid = '3', filename = 'img_0683.jpg', description = '', alttext = 'img_0683', imagedate = '2011-02-05 11:52:31', exclude = '0', sortorder = '0', meta_data = "'eyIwIjpmYWxzZSwiYXBlcnR1cmUiOiJGIDUuNiIsImNyZWRpdCI6ZmFsc2UsImNhbWVyYSI6IkNhbm9uIEVPUyBSRUJFTCBUMWkiLCJjYXB0aW9uIjpmYWxzZSwiY3JlYXRlZF90aW1lc3RhbXAiOiJGZWJydWFyeSA1LCAyMDExIDExOjUyIGFtIiwiY29weXJpZ2h0IjpmYWxzZSwiZm9jYWxfbGVuZ3RoIjoiNTUgbW0iLCJpc28iOjQwMCwic2h1dHRlcl9zcGVlZCI6IjFcLzYwIHNlYyIsImZsYXNoIjoiRmlyZWQiLCJ0aXRsZSI6ZmFsc2UsImtleXdvcmRzIjpmYWxzZSwid2lkdGgiOjE2MDAsImhlaWdodCI6MTA2Nywic2F2ZWQiOnRydWUsInRodW1ibmFpbCI6eyJ3aWR0aCI6MTAwLCJoZWlnaHQiOjc1fSwibmdnMGR5bi0weDI1MC0wMGYwdzAxMWMwMTByMTEwZjExMHIwMTB0MDEwIjp7IndpZHRoIjozNzUsImhlaWdodCI6MjUwLCJmaWxlbmFtZSI6ImltZ18wNjgzLmpwZy1uZ2dpZDAyNDItbmdnMGR5bi0weDI1MC0wMGYwdzAxMWMwMTByMTEwZjExMHIwMTB0MDEwLmpwZyIsImdlbmVyYXRlZCI6IjAuNjczMzIxMDAgMTQzMzYyOTQxMiJ9fQ=" =', image_slug = 'img_0683', extras_post_id = '310', updated_at = '1433629412' WHERE pid = '42'
----> ERROR:  syntax error at or near "img_0683"
LINE 1: ...jczMzIxMDAgMTQzMzYyOTQxMiJ9fQ=" =', image_slug = 'img_0683',...

To avoid this, ensure that the matched substring is not part of a SQL
string literal.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
dc9e036000 Replace '0000-00-00 00:00:00' with NOW() in UPDATE
As in INSERT statements, '0000-00-00 00:00:00' needs to be replaced with
a value that can be stored in PostgreSQL to avoid errors such as:

Error running :
UPDATE `wp_posts` SET `post_author` = 2, `post_date` = '2015-06-03 03:13:45', `post_date_gmt` = '0000-00-00 00:00:00', `post_content` = 'eyJpZF9maWVsZCI6IklEIiwiX19kZWZhdWx0c19zZXQiOnRydWV9', `post_content_filtered` = 'eyJpZF9maWVsZCI6IklEIiwiX19kZWZhdWx0c19zZXQiOnRydWV9', `post_title` = 'Untitled ngg_pictures', `post_excerpt` = '', `post_status` = 'draft', `post_type` = 'ngg_pictures', `comment_status` = 'closed', `ping_status` = 'closed', `post_password` = '', `post_name` = 'mixin_nextgen_table_extras', `to_ping` = '', `pinged` = '', `post_modified` = '2015-06-03 03:13:45', `post_modified_gmt` = '2015-06-03 09:13:45', `post_parent` = 0, `menu_order` = 0, `post_mime_type` = '', `guid` = 'https://example.com/?post_type=ngg_pictures&#038;p=237' WHERE `ID` = 237
---- converted to ----
UPDATE wp_posts SET post_author = 2, post_date = '2015-06-03 03:13:45', post_date_gmt = '0000-00-00 00:00:00', post_content = 'eyJpZF9maWVsZCI6IklEIiwiX19kZWZhdWx0c19zZXQiOnRydWV9', post_content_filtered = 'eyJpZF9maWVsZCI6IklEIiwiX19kZWZhdWx0c19zZXQiOnRydWV9', post_title = 'Untitled ngg_pictures', post_excerpt = '', post_status = 'draft', post_type = 'ngg_pictures', comment_status = 'closed', ping_status = 'closed', post_password = '', post_name = 'mixin_nextgen_table_extras', to_ping = '', pinged = '', post_modified = '2015-06-03 03:13:45', post_modified_gmt = '2015-06-03 09:13:45', post_parent = 0, menu_order = 0, post_mime_type = '', guid = 'https://example.com/?post_type=ngg_pictures&#038;p=237' WHERE "ID" = 237
----> ERROR:  date/time field value out of range: "0000-00-00 00:00:00"
LINE 1: ...ost_date = '2015-06-03 03:13:45', post_date_gmt = '0000-00-0...

Match the INSERT behavior and replace it with NOW() in the GMT timezone.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
debe87c368 WIP: Partial support for prefix indexing
[Work In Progress] MySQL performs prefix indexing on a few columns.
PostgreSQL lacks support for prefix indexing (although it does support
expression indexing, which can be used to similar effect), which results
in the following error message:

Error running :
ALTER TABLE wp_comments ADD KEY comment_author_email (comment_author_email(10))
---- converted to ----
CREATE INDEX wp_comments_comment_author_email ON wp_comments (comment_author_email(10)
----> ERROR:  syntax error at end of input
LINE 1: ...omment_author_email ON wp_comments (comment_author_email(10)

Since the prefix indexing does not currently appear to be advantageous
(other than working around MySQL row index size limitations), convert
these to full-column indexes.

FIXME:  SHOW INDEX needs to be updated so that it returns the requested
prefix length in order to avoid attempted index recreation during schema
upgrades.  This could be accomplished by storing the length as a comment
or some other ancillary metadata.  This is not implemented yet.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
b4b346f694 Fix row order in SHOW INDEX query
The order of rows returned from SHOW INDEX is significant, and it is
used to determine the column order in multi-column indexes.  Update the
query to return rows in the expected order to avoid errors during
upgrade (e.g. in wp_term_taxonomy_term_id_taxonomy where the column
order is not alphabetical).

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
83e5074461 Add support for sql_mode variable
This appears as both "SELECT @@SESSION.sql_mode" checked from wp-db.php
in Wordpress core during startup and as "SHOW VARIABLES LIKE 'sql_mode'"
in several extensions (all-in-one-seo-pack, flash-album-gallery, and
nextgen-gallery on my system).  Support both by returning the empty
string, which reports the default MySQL behavior (and avoids attempts to
change the mode, since all current code expects this).

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:48:28 -06:00
Kevin Locke
6aea521bf2 Rework SHOW COLUMNS/INDEX/TABLE support
Wordpress 4 makes use of SHOW COLUMNS and SHOW TABLES in addition to
SHOW INDEX, both with and without the FULL modifier.  Implement support
for these statements using queries against INFORMATION_SCHEMA.

Some of these queries use lower-case versions of these statements,
such as "show tables like 'wp_flag_pictures'", so we make sure to
recognize both the upper- and lower-case versions.

This is based, in part, on the work of raptorz in the support forum at
https://wordpress.org/support/topic/upgrade-to-wp421-fail?replies=3#post-6886123

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-06 21:47:30 -06:00
Kevin Locke
f97491346b Rewrite default '0000-00-00 00:00:00' to now()
The current rewriting changes "default '0000-00-00 00:00:00'" when it
appears in CREATE TABLE statements, but does not handle the case that a
column default value is modified.  This results in errors such as the
following during schema upgrade:

Error running :
ALTER TABLE wp_users ALTER COLUMN user_registered SET DEFAULT '0000-00-00 00:00:00'
---- converted to ----
ALTER TABLE wp_users ALTER COLUMN user_registered SET DEFAULT '0000-00-00 00:00:00'
----> ERROR:  date/time field value out of range: "0000-00-00 00:00:00"

Apply the conversion to ALTER TABLE statements as well.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-03 00:51:25 -06:00
Kevin Locke
935a99c429 Rewrite multi-table delete of wp_options
During schema upgrade, populate_options() deletes all expired transients
and their corresponding transient timeouts.  The queries produce the
following errors:

Error running :
DELETE a, b FROM wp_options a, wp_options b
		WHERE a.option_name LIKE '\_transient\_%'
		AND a.option_name NOT LIKE '\_transient\_timeout\_%'
		AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) )
		AND b.option_value < 1433110465
---- converted to ----
DELETE a, b FROM wp_options a, wp_options b
		WHERE a.option_name LIKE '\_transient\_%'
		AND a.option_name NOT LIKE '\_transient\_timeout\_%'
		AND b.option_name = CONCAT( '_transient_timeout_', SUBSTRING( a.option_name, 12 ) )
		AND b.option_value < 1433110465
----> ERROR:  syntax error at or near "a"
LINE 1: DELETE a, b FROM wp_options a, wp_options b
               ^
---------------------
Error running :
DELETE a, b FROM wp_options a, wp_options b
			WHERE a.option_name LIKE '\_site\_transient\_%'
			AND a.option_name NOT LIKE '\_site\_transient\_timeout\_%'
			AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) )
			AND b.option_value < 1433110465
---- converted to ----
DELETE a, b FROM wp_options a, wp_options b
			WHERE a.option_name LIKE '\_site\_transient\_%'
			AND a.option_name NOT LIKE '\_site\_transient\_timeout\_%'
			AND b.option_name = CONCAT( '_site_transient_timeout_', SUBSTRING( a.option_name, 17 ) )
			AND b.option_value < 1433110465
----> ERROR:  syntax error at or near "a"
LINE 1: DELETE a, b FROM wp_options a, wp_options b
               ^
---------------------

Since PostgreSQL does not support multi-table DELETE statements,
significant rewriting must be done.  Since I could not think of a good
generic way to perform this rewriting, recognize this statement
specifically and provide an alternative version.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-03 00:42:27 -06:00
Kevin Locke
3c98f08453 Define WP_USE_EXT_MYSQL for Wordpress 4 compatibility
Wordpress 4 defaults to using mysqli_* functions in preference to
mysql_*.  Since pg4wp only provides replacements for mysql_ functions,
we need to ensure that the mysql_* functions are called.  Do this by
defining WP_USE_EXT_MYSQL to true.

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
2015-06-03 00:38:31 -06:00
hawk__
eff2d4e634 Re-enabled error logging in trunk
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@969861 b8457f37-d9ea-0310-8a92-e5e31aec5664
2014-08-21 16:53:30 +00:00
hawk__
b67e7c6780 Integrated changes from http://vitoriodelage.wordpress.com/2014/06/06/add-missing-wpsql_errno-in-pg4wp-plugin/
Changes for 1.3.1 release

git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@969858 b8457f37-d9ea-0310-8a92-e5e31aec5664
2014-08-21 16:50:36 +00:00
hawk__
fb058eda35 Re-enabled error logging in trunk
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@557873 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-06-14 10:40:13 +00:00
hawk__
620c5653e2 Prepare for 1.3.0 release (versions, changelog, error logging off)
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@557870 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-06-14 10:37:41 +00:00
hawk__
3e2733096e Removed an old unused upgrade hack
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@557852 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-06-14 09:39:23 +00:00
hawk__
cb8eb1231d Corrected a problem with ID quoting when importing in WP 2.9.2
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@557841 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-06-14 09:15:09 +00:00
hawk__
72b1fa1017 Enhanced wordpress-importer compatibility
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@547119 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-21 18:06:44 +00:00
hawk__
7d70a7bc8c Removed a PHP notice in wpsql_connect()
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546732 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-20 22:17:54 +00:00
hawk__
78e876dec0 Reworked wpsql_insert_id() for better report of errors
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546724 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-20 21:57:33 +00:00
hawk__
9120c5fec2 Protect against a possible collision when handling 'ON DUPLICATE KEY'
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546689 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-20 19:24:06 +00:00
hawk__
749fe8fb59 Updated call to mysql_escape_string() which is deprecated
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546644 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-20 16:58:04 +00:00
hawk__
7af156a7c7 Update files for 1.3.0b1 release
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546585 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-20 13:47:51 +00:00
hawk__
bb14143c77 Added a handle for DROP TABLE to remove sequences that are linked with the dropped table
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546567 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-20 12:57:04 +00:00
hawk__
21754d862d Added a hack so that wp_terms_seq is updated on installation
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546556 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-20 12:30:56 +00:00
hawk__
943887362c Moved the quoting hacks for PostgreSQL 9.1+ compatibility so that they apply to all queries
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@546507 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-20 10:24:18 +00:00
hawk__
70b7af7142 Added a filter for 'CREATE TABLE IF NOT EXISTS'
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@545542 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-17 20:13:57 +00:00
hawk__
b2c7c3e662 Enhanced the ignore for unexisting relations when installing
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@544614 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-15 19:19:51 +00:00
hawk__
7692aa54c4 Corrected a typo and added a WPMU required translation
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@544612 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-15 19:17:23 +00:00
hawk__
2e144463e5 Corrected 2 matching that were not accurate enough
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@544607 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-15 19:01:56 +00:00
hawk__
bdea3e9546 Added a modifier for COUNT(.+)...ORDER BY... to be handled correctly even when ther is a newline character
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@542085 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-09 21:33:33 +00:00
hawk__
4cc22003a8 Added a handle for converting CAST(... AS CHAR) to CAST(... AS TEXT) (Problem pointed out by Aart Jan)
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@542064 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-09 20:59:27 +00:00
hawk__
cd0b6c4916 Forgot to remove 2 lines in the previous commit
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@542049 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-09 20:29:23 +00:00
hawk__
e5f2f14aa1 Added support for specifying the port in the server hostname eg. 'localhost:3128'
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@542045 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-09 20:21:42 +00:00
hawk__
dba478b671 Added support for PostgreSQL 9.1+ default config for standard_conforming_strings
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@542038 b8457f37-d9ea-0310-8a92-e5e31aec5664
2012-05-09 20:17:16 +00:00
hawk__
afadc6b033 Added a timestamp to logs
Ignore errors about table "options" not existing when installing

git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@458029 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-10-31 21:50:04 +00:00
hawk__
c0111615da Re-enabled error logging in trunk
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@436157 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-09-11 00:07:15 +00:00
hawk__
a6c2ed3467 Forgot to change version to 1.2.2
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@436154 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-09-11 00:02:08 +00:00
hawk__
c89f560605 Correct SQL_CALC_FOUND_ROWS handling as it was broken by the latest code reorganisation
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@436152 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-09-11 00:00:04 +00:00
hawk__
a9d154b1b4 Prepare for 1.2.1 stable release
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@436146 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-09-10 23:41:04 +00:00
hawk__
b661a7bde5 Moved all the rewriting code to a separate function (for easier testing)
Reworked 'ON DUPLICATE ...' handling, could fail in some cases

git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@436145 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-09-10 23:38:01 +00:00
hawk__
c9a58af607 Forgot to remove debugging code in previous commit ...
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@436142 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-09-10 22:14:28 +00:00
hawk__
5b7a8973df Modified the method for counting rows as mysql counts avery rows ignoring the limit clause
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@436140 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-09-10 22:11:30 +00:00
hawk__
fb9bcadebd Added some column types conversion for WPMU support
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@429285 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-08-27 00:36:48 +00:00
hawk__
0dbc95e1a1 Added "ADD COLUMN" support to the "ALTER TABLE" handling code
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@429284 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-08-27 00:35:29 +00:00
hawk__
5644761e17 Improved SHOW INDEX for upgrades to detect indices correctly and so don't try to recreate them
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@429283 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-08-27 00:34:15 +00:00
hawk__
79a3ad03ae Modified the way install/upgrade code is detected
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@429282 b8457f37-d9ea-0310-8a92-e5e31aec5664
2011-08-27 00:32:14 +00:00