From: Nicolas Boisselier Date: Tue, 5 Jul 2016 13:18:46 +0000 (+0100) Subject: sql_exec X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=02a4846f30b76db76e6afb293f098ec0220c8ad8;p=nb.git sql_exec --- 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 = ''; } + } //