Bug #74252 | callproc does not support warnings | ||
---|---|---|---|
Submitted: | 7 Oct 2014 15:32 | Modified: | 16 Dec 2014 0:37 |
Reporter: | Olle Nilsson | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | Connector / Python | Severity: | S3 (Non-critical) |
Version: | 2.0.1 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | callproc, stored procedures, warnings |
[7 Oct 2014 15:32]
Olle Nilsson
[8 Oct 2014 6:46]
MySQL Verification Team
Hello Olle, Thank you for the report and test case. Thanks, Umesh
[8 Oct 2014 6:48]
MySQL Verification Team
// mysql> use test Database changed mysql> mysql> DELIMITER // mysql> CREATE PROCEDURE sp() BEGIN SIGNAL SQLSTATE '01000' SET MESSAGE_TEXT = 'TEST WARNING' ; END // Query OK, 0 rows affected (0.00 sec) mysql> DELIMITER ; mysql> mysql> call sp(); Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> show warnings; +---------+------+--------------+ | Level | Code | Message | +---------+------+--------------+ | Warning | 1642 | TEST WARNING | +---------+------+--------------+ 1 row in set (0.00 sec) [root@cluster-repo mysql-advanced-5.6.22]# rpm -qa|grep mysql-connector mysql-connector-python-commercial-2.0.1-1.el6.noarch [root@cluster-repo downloads]# python Python 2.6.6 (r266:84292, Jan 22 2014, 01:49:05) [GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> >>> import mysql.connector as mc >>> cnx = mc.connect(user='root', password='', database='test') >>> >>> cur = cnx.cursor() >>> cnx.get_warnings = True >>> cur.callproc('sp') () >>> w = cur.fetchwarnings() >>> w >>>
[16 Dec 2014 0:37]
Paul Dubois
Noted in 2.0.3, 2.1.2 changelogs. When using the callproc() cursor method, warnings generated by statements executed within the procedure or generated by the procedure itself were not available to the client.