Bug #39506 Bug with the sintaxis show create table with odbc 5.1.4
Submitted: 18 Sep 2008 0:11 Modified: 18 Sep 2008 8:14
Reporter: edgar valcarcel Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:5.1.4 OS:Microsoft Windows
Assigned to: Bogdan Degtyariov CPU Architecture:Any
Tags: bug, command, SHOW CREATE TABLE

[18 Sep 2008 0:11] edgar valcarcel
Description:
We use the sentence SHOW CREATE TABLE Nametable in our applicattion, we expected a cursor with the name of the table(column 1 returned) and the sintax "CREATE TABLE resolucion (|...etc" in the column 2, like when we write the query: SHOW CREATE TABLE Nametable in mySQL Query Browser script, and what actually happens with the version 5.1.4 of myODBC over the 2nd column of the cursor returned the sintaxis says:

C|R|E|A|T|E| T|A|B|L|E| `|r|e|s|o|l|u|c|i|o|n|`| (|
  |`|f|i|e|l|d|1|`| i|n|t|(|1|0|)| N|O|T| N|U|L|L| default '0', ETC....

 where the caracter '|' add one line to each word of the the sintaxis returned like that:

C|
R|
E|
A|
T|
E|

T|
A|
B|
L|
E|
`|
r|
e|
s|
o|
l|
u|
c|
i|
o|
n|
`|.....etc

'|' represents the ANSI character: CHR(013)  in the version 3.51 "SHOW CREATE TABLE"  works well.
Why happens that?

Edgar Valcarcel
Bogota,Colombia
edgarvalcarcel@hotmail.com

How to repeat:
use  the command SHOW CREATE TABLE Nametable trought mySQL ODBC 5.1.4 and you will get a cursor with the sintaxis "CREATE TABLE" very wrong with the caracter 
'|' adding one line to each word of the sintaxis returned like that:
C|
R|
E|
A|
T|
E|

T|
A|
B|
L|
E|
`|

'|' representing the ANSI character: CHR(013) but in the version 3.51 "SHOW CREATE TABLE"  works well.
Why happens that?

Edgar Valcarcel
Bogota,Colombia
edgarvalcarcel@hotmail.com
[18 Sep 2008 8:13] Bogdan Degtyariov
Hello Edgar,

Thanks for your interest to MySQL software.
Your problem is related to the server metadata that is returned in binary(63) character set. Some functions results as "SELECT CONCAT("abc", 123)" will return the same unreadable result for your application.

MyODBC driver has special option to avoid such problems. You can either set the DSN option in the MyODBC GUI dialog ([x] always handle binary function results as character data) or use the connection string parameter OPTION=268435456.

I am marking this bug report as "Not a bug". Please let me know if the option has not helped.