diff options
author | George Peter Banyard <girgias@php.net> | 2021-03-12 20:41:15 +0000 |
---|---|---|
committer | George Peter Banyard <girgias@php.net> | 2021-03-17 00:58:00 +0000 |
commit | 32fb9b6fd17f6f5b965ac8b2fb69cbfda7603416 (patch) | |
tree | 9ed69e90abe79ed35cb387e21046d428b45486a3 /ext/pdo_mysql | |
parent | e0aab7413bc052807a62bb9861726b501c66eb19 (diff) | |
download | php-git-32fb9b6fd17f6f5b965ac8b2fb69cbfda7603416.tar.gz |
Validate string is numeric for integer PDO attribute value
Diffstat (limited to 'ext/pdo_mysql')
-rw-r--r-- | ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt | 2 | ||||
-rw-r--r-- | ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt index d6ebd87f60..fc4f2f0808 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_errmode.phpt @@ -25,7 +25,6 @@ error_reporting=E_ALL echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; } try { - /* This currently passes */ $db->setAttribute(PDO::ATTR_ERRMODE, 'pdo'); } catch (\Error $e) { echo get_class($e), ': ', $e->getMessage(), \PHP_EOL; @@ -160,6 +159,7 @@ error_reporting=E_ALL --EXPECTF-- TypeError: Attribute value must be of type int for selected attribute, array given TypeError: Attribute value must be of type int for selected attribute, stdClass given +TypeError: Attribute value must be of type int for selected attribute, string given ValueError: Error mode must be one of the PDO::ERRMODE_* constants Warning: PDO::query(): SQLSTATE[42000]: Syntax error or access violation: %d You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near '%s' at line %d in %s on line %d diff --git a/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt b/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt index d7f54bfdee..78d6ae7879 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_attr_oracle_nulls.phpt @@ -23,7 +23,6 @@ MySQLPDOTest::skip(); echo $e->getMessage(), \PHP_EOL; } try { - /* Currently passes... */ $db->setAttribute(PDO::ATTR_ORACLE_NULLS, 'pdo'); } catch (\TypeError $e) { echo $e->getMessage(), \PHP_EOL; @@ -72,6 +71,7 @@ MySQLPDOTest::skip(); --EXPECTF-- Attribute value must be of type int for selected attribute, array given Attribute value must be of type int for selected attribute, stdClass given +Attribute value must be of type int for selected attribute, string given array(1) { [0]=> array(6) { |