xref: /PHP-7.3/ext/pdo/tests/bug_40285.phpt (revision 782352c5)
1--TEST--
2PDO Common: Bug #40285 (The prepare parser goes into an infinite loop on ': or ":)
3--SKIPIF--
4<?php
5if (!extension_loaded('pdo')) die('skip');
6$dir = getenv('REDIR_TEST_DIR');
7if (false == $dir) die('skip no driver');
8require_once $dir . 'pdo_test.inc';
9PDOTest::skip();
10?>
11--FILE--
12<?php
13
14if (getenv('REDIR_TEST_DIR') === false) putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
15require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
16$db = PDOTest::factory();
17
18$db->exec('CREATE TABLE test (field1 VARCHAR(32), field2 VARCHAR(32), field3 VARCHAR(32), field4 INT)');
19
20$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
21$s = $db->prepare("INSERT INTO test VALUES( ':id', 'name', 'section', 22)" );
22$s->execute();
23
24echo "Done\n";
25?>
26--EXPECT--
27Done
28