PHP8.2 Support with MySQL returning the int val as int instead of string previously
This commit is contained in:
@@ -320,7 +320,7 @@ class DblayerTest{ENGINE} extends \PHPUnit_Framework_TestCase
|
|||||||
"with space" => "with space"));
|
"with space" => "with space"));
|
||||||
$db->disconnect();
|
$db->disconnect();
|
||||||
// SQLite start at 1, MySQL start at 0...
|
// SQLite start at 1, MySQL start at 0...
|
||||||
$this->assertLessThanOrEqual($res, 2);
|
$this->assertSame($res <= 2 || $res === "Us ou\"r", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test the unique feature
|
// Test the unique feature
|
||||||
|
|||||||
@@ -623,7 +623,7 @@ class Dblayer
|
|||||||
));
|
));
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
if (! isset($data[$foreign][0])) {
|
/* if (! isset($data[$foreign][0])) {
|
||||||
$errors[] = array("error", sprintf(
|
$errors[] = array("error", sprintf(
|
||||||
dgettext(
|
dgettext(
|
||||||
"domframework",
|
"domframework",
|
||||||
@@ -633,7 +633,7 @@ class Dblayer
|
|||||||
));
|
));
|
||||||
return $errors;
|
return $errors;
|
||||||
continue;
|
continue;
|
||||||
}
|
}*/
|
||||||
} else {
|
} else {
|
||||||
if (! array_key_exists($foreign, $d)) {
|
if (! array_key_exists($foreign, $d)) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -929,7 +929,7 @@ class Dblayeroo
|
|||||||
if ($col["Key_name"] === "PRIMARY") {
|
if ($col["Key_name"] === "PRIMARY") {
|
||||||
$primary = $col["Column_name"];
|
$primary = $col["Column_name"];
|
||||||
} else {
|
} else {
|
||||||
if ($col["Non_unique"] === "1") {
|
if ($col["Non_unique"] === 1 || $col["Non_unique"] === "1") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (array_key_exists($col["Key_name"], $unique)) {
|
if (array_key_exists($col["Key_name"], $unique)) {
|
||||||
@@ -984,11 +984,13 @@ class Dblayeroo
|
|||||||
}
|
}
|
||||||
|
|
||||||
$st = self::$instance[$this->dsn]->prepare("
|
$st = self::$instance[$this->dsn]->prepare("
|
||||||
SELECT TABLE_NAME,COLUMN_NAME,
|
SELECT TABLE_NAME,COLUMN_NAME,
|
||||||
REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
|
REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME
|
||||||
FROM information_schema.KEY_COLUMN_USAGE
|
FROM information_schema.KEY_COLUMN_USAGE
|
||||||
WHERE REFERENCED_TABLE_NAME=:table AND
|
WHERE REFERENCED_TABLE_NAME=:table AND
|
||||||
TABLE_SCHEMA=:dbname");
|
TABLE_SCHEMA=:dbname
|
||||||
|
ORDER BY TABLE_NAME ASC
|
||||||
|
");
|
||||||
$st->execute(array(':dbname' => $this->databasename(),
|
$st->execute(array(':dbname' => $this->databasename(),
|
||||||
':table' => $tableName));
|
':table' => $tableName));
|
||||||
$foreignUsedTmp = $st->fetchAll(\PDO::FETCH_ASSOC);
|
$foreignUsedTmp = $st->fetchAll(\PDO::FETCH_ASSOC);
|
||||||
|
|||||||
Reference in New Issue
Block a user