=== modified file 'ChangeLog' --- ChangeLog 2010-03-24 09:11:38 +0000 +++ ChangeLog 2010-04-29 08:24:21 +0000 @@ -16,6 +16,7 @@ * SQL_ATTR_MAX_ROWS make some SELECT statement invalid. (Bug #49726) * Certain column attributes aren't correct for date columns. (Bug #44576) * SQLPrepare causes Prefetch of table. (Bug #46411) + * SQLColumns returns wrong transfer octet length. (Bug #53235) ---- === modified file 'driver/utility.c' --- driver/utility.c 2010-03-18 20:05:12 +0000 +++ driver/utility.c 2010-04-29 03:40:41 +0000 @@ -1378,9 +1378,7 @@ case MYSQL_TYPE_DECIMAL: case MYSQL_TYPE_NEWDECIMAL: - return (field->length - - test(!(field->flags & UNSIGNED_FLAG)) - /* sign? */ - test(field->decimals)); /* decimal point? */ + return field->length; case MYSQL_TYPE_BIT: /* === modified file 'test/my_catalog.c' --- test/my_catalog.c 2010-01-31 00:29:06 +0000 +++ test/my_catalog.c 2010-04-29 08:22:47 +0000 @@ -1443,6 +1443,34 @@ } +/* + Bug #53235 - SQLColumns returns wrong transfer octet length +*/ +DECLARE_TEST(t_bug53235) +{ + SQLCHAR buf[50]; + int col_size, buf_len, dec_digits; + + ok_sql(hstmt, "drop table if exists t_bug53235"); + ok_sql(hstmt, "create table t_bug53235 (x decimal(10,3))"); + ok_stmt(hstmt, SQLColumns(hstmt, NULL, 0, NULL, 0, + (SQLCHAR *)"t_bug53235", SQL_NTS, NULL, 0)); + ok_stmt(hstmt, SQLFetch(hstmt)); + + col_size= my_fetch_int(hstmt, 7); + buf_len= my_fetch_int(hstmt, 8); + + is_num(col_size, 10); + is_num(buf_len, 12); + + expect_stmt(hstmt, SQLFetch(hstmt), SQL_NO_DATA_FOUND); + ok_stmt(hstmt, SQLFreeStmt(hstmt, SQL_CLOSE)); + ok_sql(hstmt, "drop table if exists t_bug53235"); + + return OK; +} + + BEGIN_TESTS ADD_TEST(my_columns_null) ADD_TEST(my_drop_table) @@ -1473,6 +1501,7 @@ ADD_TEST(t_bug30770) ADD_TEST(t_bug36275) ADD_TEST(t_bug39957) + ADD_TEST(t_bug53235) END_TESTS