From 1808dcf20ecd02603f8a1c548b0a484b25c25f05 Mon Sep 17 00:00:00 2001 From: Mark Newnham Date: Fri, 29 Nov 2019 18:28:11 -0700 Subject: Columns in SQLite metaindexes not reported correctly see #567 The columns list in the metaindexes funtion in the SQLite driver was returned as a CSV list, not an array --- drivers/adodb-sqlite3.inc.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/adodb-sqlite3.inc.php') diff --git a/drivers/adodb-sqlite3.inc.php b/drivers/adodb-sqlite3.inc.php index 14f3dffa..d73ff62c 100644 --- a/drivers/adodb-sqlite3.inc.php +++ b/drivers/adodb-sqlite3.inc.php @@ -449,15 +449,12 @@ class ADODB_sqlite3 extends ADOConnection { ); } /** - * There must be a more elegant way of doing this, - * the index elements appear in the SQL statement + * The index elements appear in the SQL statement * in cols[1] between parentheses * e.g CREATE UNIQUE INDEX ware_0 ON warehouse (org,warehouse) */ - $cols = explode("(",$row[1]); - $cols = explode(")",$cols[1]); - array_pop($cols); - $indexes[$row[0]]['columns'] = $cols; + preg_match_all('/\((.*)\)/',$row[1],$indexExpression); + $indexes[$row[0]]['columns'] = array_map('trim',explode(',',$indexExpression[1][0])); } if (isset($savem)) { $this->SetFetchMode($savem); -- cgit v1.3