From 02a4846f30b76db76e6afb293f098ec0220c8ad8 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 5 Jul 2016 14:18:46 +0100 Subject: [PATCH] sql_exec --- etc/dbs/ui.php | 7 +++---- lib/php/db/table.php | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/etc/dbs/ui.php b/etc/dbs/ui.php index 8ede2185..ce6a69e6 100644 --- a/etc/dbs/ui.php +++ b/etc/dbs/ui.php @@ -4,10 +4,6 @@ $CONF['_ui'] = array( 'pdo' => 'sqlite:/opt/semantico/product/releases/sem_ui/db/semantico.db', 'default_table' => 'node', - 'sql_exec' => [ - 'SET SESSION sql_mode=PIPES_AS_CONCAT', - ], - 'sql_replace' => function($sql) { if (!Db::p('db.type')) return $sql; $r = []; @@ -174,6 +170,9 @@ $CONF['ui-mysql'] = array( 'type' => 'mysql', 'name' => 'ui', 'pdo' => '', + 'sql_exec' => [ + 'SET SESSION sql_mode=PIPES_AS_CONCAT', + ], '_import' => array('_ui','_semadm'), ); #bye(realpath(dirname(__FILE__).'/../../lib/php/db.php')); diff --git a/lib/php/db/table.php b/lib/php/db/table.php index ebf2b599..951c7a7d 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -680,6 +680,7 @@ Class Table extends nb { } else { $select_fields = array('*'); } + $sql = "SELECT ".trim( $select_count[0].' '.join(',',$select_fields) ). $this->select_extras(); $sql .= " FROM ".$this->sql_name(); $sql .= $where; @@ -693,6 +694,7 @@ Class Table extends nb { } else { $limit = ''; } + } // -- 2.47.3