union

"Gokhan Demir" <[email protected]> Mon, 4 Apr 2005 03:14:25 +0300
Newsgroups gmane.comp.db.mysql.bugs
Message-ID <[email protected]>
I am trying to force some resultset metadata for nullable columns in a
unioned select statement. What I try to do is cast the null to an
appropriate datatype (DATE in my example). (I think) The selects run ok
without the union or union all statements. However, this is better to be
confirmed officially by MySQL.

 

select convert(null,DATE) as dt

union all

select convert("2005-01-01 12:12:12", DATE) as dt;

 

OR

 

select {fn convert(null,DATE)} as dt

union all

select {fn convert("2005-01-01 12:12:12", DATE)} as dt;

 

will cause the server crash. 

Version 4.1.10a, Linux x86, originally distributed binaries.

 [root@miranda ~]# uname -a

Linux miranda.lan 2.6.10-1.741_FC3 #1 Thu Jan 13 16:38:22 EST 2005 i686 i686
i386 GNU/Linux

 

Regards,

Gokhan Demir