Edit report at https://bugs.php.net/bug.php?id=72416&edit=1
ID: 72416
Updated by: nikic@php.net
Reported by: webart dot video at gmail dot com
Summary: mysqli_stmt::__construct(): Unknown type 18 sent by
the server.
-Status: Assigned
+Status: Feedback
Type: Bug
Package: MySQLi related
Operating System: Ubuntu 14.04 LTS
PHP Version: 7.0.7
-Assigned To: mysql
+Assigned To:
Block user comment: N
Private report: N
New Comment:
Does anyone still experience this issue on a current version of MySQL and PHP?
At least using MySQL 8.0.22 this does not reproduce any more, so presumably the issue has been fixed
on the server side, even though the bug report has not been closed.
Previous Comments:
------------------------------------------------------------------------
[2020-12-10 11:29:04] nikic@php.net
Related To: Bug #72041
------------------------------------------------------------------------
[2020-12-10 11:27:03] nikic@php.net
Related To: Bug #72041
------------------------------------------------------------------------
[2016-07-07 08:42:45] andrey@php.net
Hi, I have opened a MySQL server bug report as this is a server bug
Bug #82139 MySQL server sends internal column type over the wire
http://bugs.mysql.com/bug.php?id=82139
------------------------------------------------------------------------
[2016-07-07 08:20:16] andrey@php.net
Even shorter one:
<?php
/*
CREATE TABLE type18 (
tripDay datetime NOT NULL
) ENGINE=InnoDB;
INSERT INTO type18 VALUES ('2014-04-03 00:00:00');
*/
$conn = mysqli_connect('127.0.0.1', 'root', '', 'test');
$conn->query("set sql_mode=''");
$sql = "(SELECT tripDay FROM type18 ORDER BY YEAR(tripDay)) ORDER BY YEAR(tripDay)";
$stmt = $conn->prepare($sql);
var_dump($stmt, $conn->error);
?>
------------------------------------------------------------------------
[2016-07-06 14:45:29] andrey@php.net
Hi, I am able to reproduce with the following:
<?php
/*
CREATE TABLE type18 (
tripDay datetime NOT NULL,
KEY entity_index (tripDay),
KEY day_index (tripDay)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO type18 VALUES ('2014-04-03 00:00:00');
*/
$foo = mysqli_connect('127.0.0.1', 'root', '', 'test');
$query = "(SELECT
DATE_FORMAT(DATE_ADD(MAKEDATE(YEAR(tripDay), 1), INTERVAL MONTH(tripDay) - 1
MONTH),'%c/%e/%y'),
tripDay
FROM type18
ORDER BY YEAR(tripDay))
ORDER BY YEAR(tripDay)";
$foo->query("set sql_mode=''");
$x = $foo->prepare($query);
var_dump($foo->error);
?>
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=72416
--
Edit this bug report at https://bugs.php.net/bug.php?id=72416&edit=1