Changeset 1712379
- Timestamp:
- 08/11/2017 11:18:56 PM (9 years ago)
- Location:
- postgresql-for-wordpress/trunk
- Files:
-
- 2 edited
-
pg4wp/driver_pgsql.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
postgresql-for-wordpress/trunk/pg4wp/driver_pgsql.php
r969858 r1712379 90 90 { 91 91 $pg_connstr = $GLOBALS['pg4wp_connstr'].' dbname='.$dbname; 92 93 $GLOBALS['pg4wp_conn'] = pg_connect($pg_connstr); 92 93 if( !empty($GLOBALS['pg4wp_connstr'])) 94 $GLOBALS['pg4wp_conn'] = pg_connect($pg_connstr); 94 95 95 96 if( $GLOBALS['pg4wp_conn']) … … 226 227 $pattern = '/SELECT\s+([^\s]+)\s+(FROM.+)/'; 227 228 $sql = preg_replace( $pattern, 'SELECT COUNT($1) $2', $sql); 229 } 230 elseif( false !== strpos($sql, '@@SESSION.sql_mode')) 231 { 232 $sql = 'SELECT \'\';'; 228 233 } 229 234 … … 386 391 $logto = 'SHOWTABLES'; 387 392 $sql = 'SELECT tablename FROM pg_tables WHERE schemaname = \'public\';'; 393 } 394 // Rewriting SHOW FULL COLUMN (fix provided by rafaelbernard : https://gist.github.com/rafaelbernard/0249b7b665562cbab080) 395 elseif( 0 === strpos($sql, 'SHOW FULL COLUMN')) 396 { 397 $logto = 'SHOWFULL'; 398 $sql = str_replace( 'SHOW FULL COLUMNS FROM ', 'SELECT column_name FROM information_schema.columns WHERE table_name = ', $sql); 399 $sql = str_replace( '`', "'", $sql ); 388 400 } 389 401 // Rewriting optimize table -
postgresql-for-wordpress/trunk/readme.txt
r969858 r1712379 66 66 67 67 == Changelog == 68 69 * Corrected a strange behavior where effective connection may happen a second time 70 * Ignore '@@SESSION.sql_mode' 68 71 69 72 = 1.3.1 =
Note: See TracChangeset
for help on using the changeset viewer.