Bug #57505 | Client stuck to the database where a fatal error happens under STRICT_ALL_TABLES | ||
---|---|---|---|
Submitted: | 17 Oct 2010 20:35 | Modified: | 18 Oct 2010 20:37 |
Reporter: | Winfried Trümper | Email Updates: | |
Status: | Duplicate | Impact on me: | |
Category: | MySQL Server: Command-line Clients | Severity: | S1 (Critical) |
Version: | 5.1.46-log, 5.1.51 | OS: | Any (OpenSuSE 11.2 x86_64, Windows XP) |
Assigned to: | CPU Architecture: | Any |
[17 Oct 2010 20:35]
Winfried Trümper
[18 Oct 2010 4:59]
Valeriy Kravchuk
Verified with 5.1.51 on Windows XP also: C:\Program Files\MySQL\MySQL Server 5.1\bin>mysql -uroot -proot -P3310 test Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 36 Server version: 5.1.51-community MySQL Community Server (GPL) Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL v2 license Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> SET @@SQL_MODE = 'STRICT_ALL_TABLES'; Query OK, 0 rows affected (0.01 sec) mysql> DROP DATABASE IF EXISTS db1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> CREATE DATABASE db1; Query OK, 1 row affected (0.00 sec) mysql> USE db1; Database changed mysql> DROP TABLE IF EXISTS tab1; Query OK, 0 rows affected, 1 warning (0.03 sec) mysql> CREATE TABLE tab1 (col1 int NOT NULL PRIMARY KEY); Query OK, 0 rows affected (0.13 sec) mysql> DELIMITER ;; mysql> CREATE FUNCTION fun1 ( -> some_value int -> ) -> RETURNS smallint -> DETERMINISTIC -> BEGIN -> INSERT INTO tab1 SET col1 = some_value; -> RETURN(LAST_INSERT_ID()); -> END;; Query OK, 0 rows affected (0.05 sec) mysql> DELIMITER ; mysql> DROP DATABASE IF EXISTS db2; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> CREATE DATABASE db2; Query OK, 1 row affected (0.00 sec) mysql> USE db2; Database changed mysql> SELECT DATABASE(); +------------+ | DATABASE() | +------------+ | db2 | +------------+ 1 row in set (0.00 sec) mysql> SELECT db1.fun1(1); +-------------+ | db1.fun1(1) | +-------------+ | 0 | +-------------+ 1 row in set (0.09 sec) mysql> SELECT DATABASE(); +------------+ | DATABASE() | +------------+ | db2 | +------------+ 1 row in set (0.00 sec) mysql> SELECT db1.fun1(1); ERROR 1062 (23000): Duplicate entry '1' for key 'PRIMARY' mysql> SELECT DATABASE(); +------------+ | DATABASE() | +------------+ | db1 | +------------+ 1 row in set (0.00 sec) mysql> \s -------------- mysql Ver 14.14 Distrib 5.1.51, for Win32 (ia32) Connection id: 36 Current database: db1 Current user: root@localhost SSL: Not in use Using delimiter: ; Server version: 5.1.51-community MySQL Community Server (GPL) Protocol version: 10 Connection: localhost via TCP/IP Server characterset: utf8 Db characterset: utf8 Client characterset: utf8 Conn. characterset: utf8 TCP port: 3310 Uptime: 11 days 15 hours 27 min 20 sec Threads: 1 Questions: 604 Slow queries: 0 Opens: 1515 Flush tables: 1 Open tables: 2 Queries per second avg: 0.0 --------------
[18 Oct 2010 20:37]
Konstantin Osipov
A duplicate of Bug#54375.