3.51.17 error 1064 - can't get field metadata due to syntax error in SQL query

Леженко Андрей Викторович <[email protected]>
Newsgroups gmane.comp.db.mysql.odbc
Message-ID <F28471D39AC6466AA913A212D0832C31@avlpc>
mysql-connector-odbc-3.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, "`,`");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.