diff options
Diffstat (limited to 'drivers/adodb-sqlite3.inc.php')
| -rw-r--r-- | drivers/adodb-sqlite3.inc.php | 9 |
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); |
