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);
|
||||
|
||||
$st = self::$instance[$this->dsn]->prepare (
|
||||
"SELECT * FROM sqlite_sequence WHERE name='$tableName'");
|
||||
$st->execute ();
|
||||
$content = $st->fetchAll (\PDO::FETCH_ASSOC);
|
||||
if (count ($content) > 0 && $primary !== "")
|
||||
$fields[$primary][] = "autoincrement";
|
||||
try
|
||||
{
|
||||
$st = self::$instance[$this->dsn]->prepare (
|
||||
"SELECT * FROM sqlite_sequence WHERE name='$tableName'");
|
||||
$st->execute ();
|
||||
$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 (
|
||||
"PRAGMA foreign_key_list('$tableName')");
|
||||
|
||||
Reference in New Issue
Block a user