Bug #19599 duplication of information_schema column value in a CONCAT expr with user var
| Submitted: | 8 May 2006 0:04 | Modified: | 9 Jun 2006 16:22 |
|---|---|---|---|
| Reporter: | Roland Bouman | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 5.1.9/5.0BK/5.1BK | OS: | Windows (win xp pro/linux) |
| Assigned to: | Sergei Glukhov | CPU Architecture: | Any |
[8 May 2006 0:04]
Roland Bouman
[8 May 2006 13:53]
MySQL Verification Team
Thank you for the bug report.
miguel@hegel:~/dbs/5.0> bin/mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.22-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database sakila;
Query OK, 1 row affected (0.03 sec)
mysql> use sakila
Database changed
mysql> create table actor (actor_id int);
Query OK, 0 rows affected (0.02 sec)
mysql> create table actor_info (actor_id int, name char(12));
Query OK, 0 rows affected (0.03 sec)
mysql> set @a:= '.';
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql> select concat(@a, table_name)
-> , @a
-> , table_name
-> from information_schema.tables
-> where table_schema = 'sakila'
-> limit 2;
+------------------------+------+------------+
| concat(@a, table_name) | @a | table_name |
+------------------------+------+------------+
| .actor | . | actor |
| .actoractor_info | . | actor_info |
+------------------------+------+------------+
2 rows in set (0.01 sec)
mysql>
[29 May 2006 9:25]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/6954
[2 Jun 2006 13:23]
Alexander Barkov
It is not correct to fix Item_func_concat::val_str(). Item_func_get_user_var::val_str() should be fixed instead. The String value returned from Item_func_get_user_var::val_str() should be marked using String::mark_as_const(), which will prevent CONCAT from reusing it as a buffer for concatenation result. Another way is to fix user_var_entry::val_str() to do mark_as_const().
[5 Jun 2006 9:07]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/7261
[5 Jun 2006 10:38]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/7265
[5 Jun 2006 10:40]
Alexander Barkov
This patch looks ok to push: http://lists.mysql.com/commits/7265
[6 Jun 2006 7:44]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/7307
[6 Jun 2006 7:47]
Sergei Glukhov
Fixed in 5.0.23
[9 Jun 2006 16:22]
Paul DuBois
Noted in 5.0.23 changelog. Using CONCAT(@user_var, col_name), where col_name is a column in an INFORMATION_SCHEMA table, could cause erroneous duplication of data in the query result.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.058 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.