Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

mysqlnd: error message is inappropriate in some cases #11950

Closed
@SakiTakamachi

Description

@SakiTakamachi

Description

This is an issue I noticed while working on this fix.
#11912

This line sets theCR_MALFORMED_PACKET error.

SET_CLIENT_ERROR(error_info,CR_MALFORMED_PACKET,UNKNOWN_SQLSTATE,"Malformed packet");

However, theCR_SERVER_GONE_ERROR error may already be set at this point.

SET_CLIENT_ERROR(error_info,CR_SERVER_GONE_ERROR,UNKNOWN_SQLSTATE,mysqlnd_server_gone);

Therefore, aCR_MALFORMED_PACKET error is output when anCR_SERVER_GONE_ERROR error should be output.

Fatal error: Uncaught mysqli_sql_exception: Malformed packet in /var/www/html/test/test.php:11

I get the following error message in the same situation when building with libmysqlclient :

Fatal error: Uncaught mysqli_sql_exception: Lost connection to MySQL server during query in /var/www/html/test/test.php:11

The code to reproduce:

<?php$driver =newmysqli_driver();$driver->report_mode =MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT;$mysqli =newmysqli("mysql","root","","test");// my envfgets(STDIN);// Restarted mysql, then press entervar_dump($mysqli->select_db("test2"));

PHP Version

PHP 8.0+

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp