Annotation of embedaddon/php/ext/pdo_mysql/tests/bug53551.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #44327 (PDORow::queryString property & numeric offsets / Crash)
! 3: --SKIPIF--
! 4: <?php
! 5: require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'skipif.inc');
! 6: require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc');
! 7: MySQLPDOTest::skip();
! 8: $db = MySQLPDOTest::factory();
! 9: ?>
! 10: --FILE--
! 11: <?php
! 12: include __DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc';
! 13: $db = MySQLPDOTest::factory();
! 14:
! 15: $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, 0);
! 16:
! 17: $createSql = "CREATE TABLE `bug53551` (
! 18: `count` bigint(20) unsigned NOT NULL DEFAULT '0'
! 19: )";
! 20:
! 21: $db->exec('drop table if exists bug53551');
! 22: $db->exec($createSql);
! 23: $db->exec("insert into bug53551 set `count` = 1 ");
! 24: $db->exec("SET sql_mode = 'Traditional'");
! 25: $sql = 'UPDATE bug53551 SET `count` = :count';
! 26: $stmt = $db->prepare($sql);
! 27:
! 28: $values = array (
! 29: 'count' => NULL,
! 30: );
! 31:
! 32: echo "1\n";
! 33: $stmt->execute($values);
! 34: var_dump($stmt->errorInfo());
! 35:
! 36: echo "2\n";
! 37: $stmt->execute($values);
! 38: var_dump($stmt->errorInfo());
! 39:
! 40: echo "\ndone\n";
! 41:
! 42: ?>
! 43: --CLEAN--
! 44: <?php
! 45: include __DIR__ . DIRECTORY_SEPARATOR . 'mysql_pdo_test.inc';
! 46: $db = MySQLPDOTest::factory();
! 47: $db->exec('DROP TABLE IF EXISTS bug53551');
! 48: ?>
! 49: --EXPECTF--
! 50: 1
! 51:
! 52: Warning: PDOStatement::execute(): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'count' cannot be null in %s on line %d
! 53: array(3) {
! 54: [0]=>
! 55: string(5) "23000"
! 56: [1]=>
! 57: int(1048)
! 58: [2]=>
! 59: string(29) "Column 'count' cannot be null"
! 60: }
! 61: 2
! 62:
! 63: Warning: PDOStatement::execute(): SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'count' cannot be null in %s on line %d
! 64: array(3) {
! 65: [0]=>
! 66: string(5) "23000"
! 67: [1]=>
! 68: int(1048)
! 69: [2]=>
! 70: string(29) "Column 'count' cannot be null"
! 71: }
! 72:
! 73: done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>