distal-attribute
distal-attribute
distal-attribute
distal-attribute

Date And Number set to variable become HEX value

navia_ang posted 8 months ago in Running SQL scripts

after im upgrade from HeidiSQL_9.3.0.5107 to latest, date or number where set to variable become HEX values. So i must convert/cast again.

for example :

set @"a"=now();
set @"b"=123;
select @"a" , date(@"a"), convert (@"a" using utf8) , @"b",  convert (@"b" using utf8);

result :

|| *@"a"* || *date(@"a")* || *convert (@"a" using utf8)* || *@"b"* || *convert (@"b" using utf8)* ||
|| 0x323031372D30322D31302031333A35313A3338 || 2017-02-10 || 2017-02-10 13:51:38 || 0x313233 || 123 ||

Here mysql.ini character_set_client, character_set_connection, character_set_results, character_set_server = utf8 collation_connection, collation_server = utf_general_ci collation_database = latin1_swedish_ci

kalvaro posted 8 months ago

What version have you upgraded to? I cannot reproduce with HeidiSQL/9.4.0.5151 and MySQL/5.5.46, no matter whether "View binary data as text" is clicked or not :-?

Screenshot

kalvaro posted 8 months ago

Oh... I had a spare MySQL/5.139 server out there and I finally got this:

Screenshot

Apparently there was a bug in earlier MySQL Server versions where certain dates were reported to be binary. You'll have to enable the "View binary data as text" toolbar button.

navia_ang posted 8 months ago

Solved. Thanks @Kalvaro.

Please login to leave a reply, or register at first.