3.51.17 error 1064 - can 't get field metadata due to syntax error in SQL query 2007-07-19 - By 565=:> =4@(protected) 8:B>@>28G
Back mysql-connector-odbc-3 (See http://dbc-3.ora-code.com).51.17r581/driver/catalog.c
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
/* Build a SELECT ... LIMIT 0 to get the field metadata. */ if (!(select= (char *)my_malloc(sizeof(char) * (ulong)result->row_count * (NAME_LEN + 1) + NAME_LEN * 2, MYF(0)))) { set_mem_error(mysql); return NULL; }
to= strxmov(select, "SELECT `", NullS); while ((row= mysql_fetch_row(result))) { lengths= mysql_fetch_lengths(result); to+= mysql_real_escape_string(mysql, to, row[0], lengths[0]); to= strmov(to, "`,"); } *(--to)= '\0';
to= strmov(to, " FROM `"); if (cbCatalog) { to+= mysql_real_escape_string(mysql, to, (char *)szCatalog, cbCatalog); to= strmov(to, "`.`"); }
to+= mysql_real_escape_string(mysql, to, (char *)szTable, cbTable); to= strmov(to, "` LIMIT 0"); -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
I think line 772 must be
strmov(to, "`,`");
|
|