dblayeroo: getTableSchema for sqlite if no autoincrement field is defined, the sqlite_sequence table doesn't exists and must not crash the method
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3775 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -676,12 +676,19 @@ class dblayeroo
|
|||||||
}
|
}
|
||||||
ksort ($unique);
|
ksort ($unique);
|
||||||
|
|
||||||
$st = self::$instance[$this->dsn]->prepare (
|
try
|
||||||
"SELECT * FROM sqlite_sequence WHERE name='$tableName'");
|
{
|
||||||
$st->execute ();
|
$st = self::$instance[$this->dsn]->prepare (
|
||||||
$content = $st->fetchAll (\PDO::FETCH_ASSOC);
|
"SELECT * FROM sqlite_sequence WHERE name='$tableName'");
|
||||||
if (count ($content) > 0 && $primary !== "")
|
$st->execute ();
|
||||||
$fields[$primary][] = "autoincrement";
|
$content = $st->fetchAll (\PDO::FETCH_ASSOC);
|
||||||
|
if (count ($content) > 0 && $primary !== "")
|
||||||
|
$fields[$primary][] = "autoincrement";
|
||||||
|
}
|
||||||
|
catch (\Exception $e)
|
||||||
|
{
|
||||||
|
// If no autoincrement key, the sqlite_sequence table doesn't exists
|
||||||
|
}
|
||||||
|
|
||||||
$st = self::$instance[$this->dsn]->prepare (
|
$st = self::$instance[$this->dsn]->prepare (
|
||||||
"PRAGMA foreign_key_list('$tableName')");
|
"PRAGMA foreign_key_list('$tableName')");
|
||||||
|
|||||||
Reference in New Issue
Block a user