sysown / proxysql

High-performance MySQL proxy with a GPL license.
http://www.proxysql.com
GNU General Public License v3.0
6.06k stars 983 forks source link

Unexpected warning when using mysqli: Protocol error. Server sent false length #4400

Open ybelony opened 11 months ago

ybelony commented 11 months ago

ProxySQL version 2.3.2-10-g8cd66cf, codename Truls DEbian 11.8 PHP 7.4.33 mysql Ver 15.1 Distrib 10.11.5-MariaDB

code used to reproduce:


 <?php

            $host = "127.0.0.1";
            $port = 6033 ;
            $dbusername = "xxxxx";
            $dbpassword = "xxxx";
            $dbname = "xxxxx";
            $conn = new mysqli($host, $dbusername, $dbpassword, $dbname, $port);
            if(!$conn)
            {
             die("connection failed: ". mysqli_connect_errno());
             }
             else{
                 echo "Connected successfully";
                 if ($result = $conn -> query("SELECT * FROM xxxxx")) {
                    echo "Returned rows are: " . $result -> num_rows;
                    $result -> free_result();
                 }

                }
    ?>

For each column in the table, the following warning is sent: PHP Warning: mysqli::query(): Protocol error. Server sent false length. Expected 12

No warning/errors when going straight to the mariadb.

renecannao commented 10 months ago

Hi @ybelony .

Can you please provide a complete test case? I think that at the very minimum we need the table definition.

Thanks

SamMousa commented 4 days ago

Hi @renecannao, I ran into the same issue. Here's a query that doesn't even use a table:

 [yii\db\Exception] PDOStatement::execute(): Protocol error. Server sent false length. Expected 12 at /project/vendor/yiisoft/yii2/db/Command.php:1320
The SQL being executed was: SELECT 15 + 5 AS `value`