Bug #54043 Connector/C uses table_type in tests
Submitted: 27 May 2010 19:53 Modified: 7 Jan 2011 10:58
Reporter: Sveta Smirnova Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / C Severity:S3 (Non-critical)
Version:6.0.2 OS:Any
Assigned to: Ulf Wendel CPU Architecture:Any

[27 May 2010 19:53] Sveta Smirnova
Description:
Connector/C uses table_type in tests while this variable is deprecated and removed in 5.5 series.

How to repeat:
In unittest/libmysql/my_test.h, 452L, 12641C:

static int reset_connection(MYSQL *mysql) {
  int rc;
...
  rc= mysql_query(mysql, "SET table_type='MyISAM'");
 

Suggested fix:
rc= mysql_query(mysql, "SET storage_engine='MyISAM'");

Or add version checking if you want support older versions of server.
[7 Jan 2011 10:58] Ulf Wendel
if (mysql_get_server_version(mysql) < 50400)
    rc= mysql_query(mysql, "SET table_type='MyISAM'");
  else
    rc= mysql_query(mysql, "SET storage_engine='MyISAM'");

Hmm, judging from the source, there's already a test for the server version and table_type is only used for MySQL 5.0.4 or older. If that test fails with 5.5, there's something up with mysql_get_server_version(). In any case its not a test failure. The test is written in a portable way.

Ulf