gpt4 book ai didi

Mysql 在一个简单的选择后关闭了带有 30k COM_FIELD_LIST 警告的连接

转载 作者:行者123 更新时间:2023-11-30 21:47:03 29 4
gpt4 key购买 nike

基本上,问题在标题中,产生这种情况的确切顺序如下。出于某种原因,带有 LIMIT 2 的 SELECT 没问题,但是带有 LIMIT 1 的 SELECT 会产生多个警告并关闭连接。

在阅读了相关内容之后,警告文本在我的情况下也毫无意义 - 毕竟,我并不是要调用某些 PHP 函数或其他东西,我只是在进行简单的数据库调用。

感谢所有能帮助我做出正确判断的人。

mysql>  SELECT @@version;
+-------------------------+
| @@version |
+-------------------------+
| 5.7.21-0ubuntu0.16.04.1 |
+-------------------------+
1 row in set (0.00 sec)

mysql> show warnings limit 10;
Empty set (0.00 sec)

mysql> explain fru_log_module;
+------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| turn_id | int(10) unsigned | NO | | NULL | |
| stime | int(10) unsigned | NO | | NULL | |
| event_type | int(10) unsigned | NO | | NULL | |
| user_id | int(10) unsigned | NO | | NULL | |
| message | text | NO | | NULL | |
| count | int(10) unsigned | NO | | NULL | |
+------------+------------------+------+-----+---------+----------------+
7 rows in set (0.00 sec)

mysql> SELECT * FROM fru_log_module ORDER BY id DESC LIMIT 2;
+----+---------+------------+------------+---------+-----------------------+-------+
| id | turn_id | stime | event_type | user_id | message | count |
+----+---------+------------+------------+---------+-----------------------+-------+
| 32 | 121 | 1518708294 | 3 | 3 | start TurnStatusOrg; | 1 |
| 31 | 121 | 1518708007 | 3 | 3 | start TurnStatusOrg; | 1 |
+----+---------+------------+------------+---------+-----------------------+-------+
2 rows in set (0.00 sec)

mysql> SELECT * FROM fru_log_module ORDER BY id DESC LIMIT 1;
Empty set, 29696 warnings (0.00 sec)

mysql> show warnings limit 10;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> use stage
No connection. Trying to reconnect...
Connection id: 7161012
Current database: *** NONE ***

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show warnings limit 10;
+---------+------+------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------------------------------------------------------------------------+
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |
+---------+------+------------------------------------------------------------------------------------------------------------------------+
10 rows in set (0.00 sec)

最佳答案

mysql> SELECT `id` FROM `sthng` WHERE `blaid`='126435217';
Empty set, 30208 warnings (0.00 sec)
mysql> show warnings;
ERROR 2013 (HY000): Lost connection to MySQL server during query
mysql> show warnings;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 892166
Current database: mine

+---------+------+------------------------------------------------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------------------------------------------------------------------------+
| Warning | 1287 | 'COM_FIELD_LIST' is deprecated and will be removed in a future release. Please use SHOW COLUMNS FROM statement instead |

出于某种原因,这按预期工作:

SELECT `id` FROM `sthng` WHERE `blaid`=126435217;
+---------+
| id |
+---------+
| 3204457 |
+---------+
1 row in set (0.00 sec)

由于某些原因,我只在 mysql 控制台客户端上遇到此问题。最近突然出现这个问题,我有 5.7.23 版本的日志。应该打开一份错误报告。

关于Mysql 在一个简单的选择后关闭了带有 30k COM_FIELD_LIST 警告的连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48943739/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com