com php-src: Merge branch 'PHP-5.6' into PHP-7.0: NEWS ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.r e ext/pdo/tests/bug_47769.phpt ext/pdo/tests/
bug_65946.phpt
| From: | Matteo Beccati | Date: | Mon, 04 Apr 2016 22:07:02 +0000 |
| Subject: | com php-src: Merge branch 'PHP-5.6' into PHP-7.0: NEWS ext/pdo/pdo_sql_parser.c ext/pdo/pdo_sql_parser.r e ext/pdo/tests/bug_47769.phpt ext/pdo/tests/ bug_65946.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-91598@lists.php.net to get a copy of this message | ||
Commit: 4090e709aa3505e414243d4e19e18804ea8371e4
Author: Matteo Beccati <mbeccati@php.net> Tue, 5 Apr 2016 00:07:02 +0200
Parents: d2948d4b71cefe31b686e6354ba06cc675537e78 30925cd49826c59ea8459a24bcb24d47c2ce562d
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4090e709aa3505e414243d4e19e18804ea8371e4
Log:
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
Fixed bug #71447 (Quotes inside comments not properly handled)
Fixed a few PDO tests to conform to PDO Common standards
news entry #69537
Fix #69537: __debugInfo with empty string for key gives error
Conflicts:
Zend/zend_compile.c
Bugs:
https://bugs.php.net/71447
https://bugs.php.net/69537
Changed paths:
MM NEWS
MM ext/pdo/pdo_sql_parser.c
MM ext/pdo/pdo_sql_parser.re
AM ext/pdo/tests/bug_47769.phpt
AM ext/pdo/tests/bug_65946.phpt
Diff:
diff --cc NEWS
index 44979e8,0f9594e..5ff99fa
--- a/NEWS
+++ b/NEWS
@@@ -39,11 -21,9 +39,13 @@@ PH
- PDO:
. Fixed bug #52098 (Own PDOStatement implementation ignore __call()).
(Daniel kalaspuffar, Julien)
+ . Fixed bug #71447 (Quotes inside comments not properly handled).
+ (Matteo)
+- PDO_DBlib:
+ . Fixed bug #71943 (dblib_handle_quoter needs to allocate an extra byte).
+ (Adam Baratz)
+
- Postgres:
. Fixed bug #71820 (pg_fetch_object binds parameters before call
constructor). (Anatol)
diff --cc ext/pdo/pdo_sql_parser.c
index 84f6ac3,5a41978..0095c3d
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@@ -418,10 -374,10 +374,10 @@@ yy39
++YYCURSOR;
#line 58 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
- #line 422 "ext/pdo/pdo_sql_parser.c"
+ #line 378 "ext/pdo/pdo_sql_parser.c"
}
#line 66 "ext/pdo/pdo_sql_parser.re"
-
+
}
struct placeholder {
diff --cc ext/pdo/tests/bug_47769.phpt
index 0000000,482f060..f713eff
mode 000000,100644..100644
--- a/ext/pdo/tests/bug_47769.phpt
+++ b/ext/pdo/tests/bug_47769.phpt
@@@ -1,0 -1,37 +1,40 @@@
+ --TEST--
+ PDO Common: Bug #47769 (Strange extends PDO)
+ --SKIPIF--
+ <?php
+ if (!extension_loaded("pdo_sqlite"))
+ die("skip: PDO_SQLite not available");
+ ?>
+ --FILE--
+ <?php
+
+ class test extends PDO
+ {
+ protected function isProtected() {
+ echo "this is a protected method.\n";
+ }
+ private function isPrivate() {
+ echo "this is a private method.\n";
+ }
+
+ public function quote($str, $paramtype = NULL) {
+ $this->isProtected();
+ $this->isPrivate();
+ print $str ."\n";
+ }
+ }
+
+ $test = new test('sqlite::memory:');
+ $test->quote('foo');
+ $test->isProtected();
+
+ ?>
+ --EXPECTF--
+ this is a protected method.
+ this is a private method.
+ foo
+
-Fatal error: Call to protected method test::isProtected() from context '' in %s on line
%d
++Fatal error: Uncaught Error: Call to protected method test::isProtected() from context
'' in %s:%d
++Stack trace:
++#0 {main}
++ thrown in %s on line %d
diff --cc ext/pdo/tests/bug_65946.phpt
index 0000000,d538218..13a622e
mode 000000,100644..100644
--- a/ext/pdo/tests/bug_65946.phpt
+++ b/ext/pdo/tests/bug_65946.phpt
@@@ -1,0 -1,32 +1,40 @@@
+ --TEST--
+ PDO Common: Bug #65946 (pdo_sql_parser.c permanently converts values bound to strings)
+ --SKIPIF--
+ <?php
+ if (!extension_loaded('pdo')) die('skip');
+ $dir = getenv('REDIR_TEST_DIR');
+ if (false == $dir) die('skip no driver');
+ require_once $dir . 'pdo_test.inc';
+ PDOTest::skip();
+ ?>
+ --FILE--
+ <?php
+ if (getenv('REDIR_TEST_DIR') === false)
putenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
+ require_once getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
+ $db = PDOTest::factory();
+ $db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true);
+ $db->exec('CREATE TABLE test(id int)');
+ $db->exec('INSERT INTO test VALUES(1)');
-$stmt = $db->prepare('SELECT * FROM test LIMIT :limit');
++if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'firebird') {
++ $sql = 'SELECT FIRST :limit * FROM test';
++} else if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'oci') {
++ //$sql = 'SELECT * FROM test FETCH FIRST :limit ROWS ONLY'; // Oracle 12c syntax
++ $sql = "select id from (select a.*, rownum rnum from (SELECT * FROM test) a where rownum
<= :limit)";
++} else {
++ $sql = 'SELECT * FROM test LIMIT :limit';
++}
++$stmt = $db->prepare($sql);
+ $stmt->bindValue('limit', 1, PDO::PARAM_INT);
+ if(!($res = $stmt->execute())) var_dump($stmt->errorInfo());
+ if(!($res = $stmt->execute())) var_dump($stmt->errorInfo());
+ var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
+ ?>
+ --EXPECTF--
+ array(1) {
+ [0]=>
+ array(1) {
+ ["id"]=>
+ string(1) "1"
+ }
+ }