summaryrefslogtreecommitdiff
path: root/drivers/adodb-sqlite3.inc.php
diff options
context:
space:
mode:
authorMark Newnham <mark@newnhams.com>2019-11-29 18:28:11 -0700
committerMark Newnham <mark@newnhams.com>2019-11-29 18:28:11 -0700
commit1808dcf20ecd02603f8a1c548b0a484b25c25f05 (patch)
tree5c8b02b7f93f2207008da8585f8e612587b0069c /drivers/adodb-sqlite3.inc.php
parent8eaf842d19e4206e1c44e0eda44688ebfa1728ed (diff)
downloadadodb-1808dcf20ecd02603f8a1c548b0a484b25c25f05.tar.gz
adodb-1808dcf20ecd02603f8a1c548b0a484b25c25f05.tar.bz2
adodb-1808dcf20ecd02603f8a1c548b0a484b25c25f05.zip
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
Diffstat (limited to 'drivers/adodb-sqlite3.inc.php')
-rw-r--r--drivers/adodb-sqlite3.inc.php9
1 files changed, 3 insertions, 6 deletions
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);