Bug #6134 | "protocol level" field type from select @variable always returns string | ||
---|---|---|---|
Submitted: | 17 Oct 2004 12:49 | Modified: | 22 Nov 2005 8:02 |
Reporter: | Levap Aretnyd | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 5.0.2-alpha-debug | OS: | Windows (Windows 2003) |
Assigned to: | Ramil Kalimullin | CPU Architecture: | Any |
[17 Oct 2004 12:49]
Levap Aretnyd
[19 Oct 2004 0:47]
MySQL Verification Team
Verified on latest BK source on Linux.
[9 Aug 2005 14:31]
Mark Matthews
Please retest to determine platform-specificness.
[13 Aug 2005 7:03]
Vasily Kishkin
Verified on Window 2003 - mysql 5.0.11. mysql> SHOW CREATE TABLE test1; +-------+----------------------------------------------------------------------- -----------------------+ | Table | Create Table | +-------+----------------------------------------------------------------------- -----------------------+ | test1 | CREATE TABLE `test1` ( `@a` bigint(20) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +-------+----------------------------------------------------------------------- -----------------------+ 1 row in set (0.00 sec) mysql> SHOW CREATE TABLE test2; +-------+----------------------------------------------------------------------- --------+ | Table | Create Table | +-------+----------------------------------------------------------------------- --------+ | test2 | CREATE TABLE `test2` ( `@a` longtext ) ENGINE=MyISAM DEFAULT CHARSET=latin1 | +-------+----------------------------------------------------------------------- --------+ 1 row in set (0.00 sec)
[22 Nov 2005 8:02]
Ramil Kalimullin
Thanks for the bug report. It's not a bug, see Item_func_get_user_var::field_type().
[23 Nov 2005 21:09]
Sergei Golubchik
It's intentional behaviour. The comment Ramil is referring to explains: We must always return variables as strings to guard against selects of type select @t1:=1,@t1,@t:="hello",@t from foo where (@t1:= t2.b)