[MDEV-5444] COERCIBILITY() returns different results in prepared vs direct execution Created: 2013-12-13  Updated: 2022-09-08

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.36, 10.0.10
Fix Version/s: 5.5

Type: Bug Priority: Minor
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: upstream


 Description   

COERCIBILITY() returns different results in prepared vs direct
execution in some tricky cases, e.g. conversion of a temporal
hybrid function to a non-ASCII character set:

mysql> SET NAMES utf8, collation_connection=utf16_general_ci;
Query OK, 0 rows affected (0.00 sec)
 
mysql> SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY));
+-----------------------------------------------------------------------+
| COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)) |
+-----------------------------------------------------------------------+
|                                                                     4 |
+-----------------------------------------------------------------------+
1 row in set (3.24 sec)
 
mysql> PREPARE stmt FROM "SELECT COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY))";
Query OK, 0 rows affected (0.00 sec)
Statement prepared
 
mysql> EXECUTE stmt;
+-----------------------------------------------------------------------+
| COERCIBILITY(CONCAT(TIMESTAMP'2013-11-15 00:41:28' - INTERVAL 7 DAY)) |
+-----------------------------------------------------------------------+
|                                                                     2 |
+-----------------------------------------------------------------------+
1 row in set (0.00 sec)
 

This, in particular, make some tests fail in --ps mode but pass in "normal" mode:
http://buildbot.askmonty.org/buildbot/builders/bld-dan-debug/builds/985/steps/test_1/logs/stdio

Prepared execution should be fixed to return the same results with direct execution.



 Comments   
Comment by Alexander Barkov [ 2013-12-13 ]

Make sure to remove "--disable_ps_protocol" in mysql-test/include/ctype_datetime.inc after fixing this bug

Comment by Elena Stepanova [ 2014-04-09 ]

Also reproducible on MySQL 5.6.

Generated at Thu Feb 08 07:04:26 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.