Add support for UNIX_TIMESTAMP
git-svn-id: https://plugins.svn.wordpress.org/postgresql-for-wordpress/trunk@195515 b8457f37-d9ea-0310-8a92-e5e31aec5664
This commit is contained in:
@@ -151,6 +151,10 @@
|
|||||||
$pattern = '/DATE_ADD[ ]*\(([^,]+),([^\)]+)\)/';
|
$pattern = '/DATE_ADD[ ]*\(([^,]+),([^\)]+)\)/';
|
||||||
$sql = preg_replace( $pattern, '($1 + $2)', $sql);
|
$sql = preg_replace( $pattern, '($1 + $2)', $sql);
|
||||||
|
|
||||||
|
// UNIX_TIMESTAMP in MYSQL returns an integer
|
||||||
|
$pattern = '/UNIX_TIMESTAMP\(([^\)])\)';
|
||||||
|
$sql = preg_replace( $pattern, 'ROUND(DATE_PART(\'epoch\',$1))', $sql);
|
||||||
|
|
||||||
$date_funcs = array(
|
$date_funcs = array(
|
||||||
'YEAR(' => 'EXTRACT(YEAR FROM ',
|
'YEAR(' => 'EXTRACT(YEAR FROM ',
|
||||||
'MONTH(' => 'EXTRACT(MONTH FROM ',
|
'MONTH(' => 'EXTRACT(MONTH FROM ',
|
||||||
|
@@ -50,6 +50,7 @@ There is no screenshot for this plugin
|
|||||||
|
|
||||||
== Changelog ==
|
== Changelog ==
|
||||||
|
|
||||||
|
* Added UNIX_TIMESTAMP support
|
||||||
* Added DAYOFMONTH support (Thanks to Pete Deffendol for noticing the problem)
|
* Added DAYOFMONTH support (Thanks to Pete Deffendol for noticing the problem)
|
||||||
* Upgrading from WP 2.8.6 to WP 2.9.1 works with a minor error
|
* Upgrading from WP 2.8.6 to WP 2.9.1 works with a minor error
|
||||||
Upgrading should remove an index on table "wp_options" that may not exist, throwing an error
|
Upgrading should remove an index on table "wp_options" that may not exist, throwing an error
|
||||||
|
Reference in New Issue
Block a user