Index: driver/results.c =================================================================== --- driver/results.c (revision 1020) +++ driver/results.c (working copy) @@ -579,7 +579,7 @@ SQLPOINTER CharacterAttributePtr, SQLSMALLINT BufferLength, SQLSMALLINT *StringLengthPtr, - SQLLEN *NumericAttributePtr) + SQLULEN *NumericAttributePtr) { MYSQL_FIELD *field; STMT FAR *stmt= (STMT FAR*) StatementHandle; @@ -771,7 +771,7 @@ case SQL_COLUMN_PRECISION: case SQL_DESC_PRECISION: - *(SQLINTEGER *)NumericAttributePtr= get_column_size(stmt, field, + *(SQLUINTEGER *)NumericAttributePtr= get_column_size(stmt, field, FALSE); break; @@ -869,7 +869,7 @@ SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, #ifdef USE_SQLCOLATTRIBUTE_SQLLEN_PTR - SQLLEN *pfDesc + SQLULEN *pfDesc #else SQLPOINTER pfDesc #endif @@ -904,7 +904,7 @@ SQLPOINTER rgbDesc, SQLSMALLINT cbDescMax, SQLSMALLINT *pcbDesc, - SQLLEN *pfDesc) + SQLULEN *pfDesc) { return get_col_attr(hstmt, icol, fDescType, rgbDesc, cbDescMax, pcbDesc, pfDesc); Index: driver/utility.c =================================================================== --- driver/utility.c (revision 1021) +++ driver/utility.c (working copy) @@ -571,12 +571,12 @@ @return The column size of the field */ -SQLLEN get_column_size(STMT *stmt, MYSQL_FIELD *field, +SQLULEN get_column_size(STMT *stmt, MYSQL_FIELD *field, my_bool actual) { CHARSET_INFO *charset= get_charset(field->charsetnr, MYF(0)); unsigned int mbmaxlen= charset ? charset->mbmaxlen : 1; - SQLLEN length= actual ? field->max_length : field->length; + SQLULEN length= actual ? field->max_length : field->length; switch (field->type) { case MYSQL_TYPE_TINY: Index: driver/catalog.c =================================================================== --- driver/catalog.c (revision 1020) +++ driver/catalog.c (working copy) @@ -818,7 +818,7 @@ } /* COLUMN_SIZE */ - sprintf(buff, "%ld", get_column_size(stmt, field, FALSE)); + sprintf(buff, "%u", get_column_size(stmt, field, FALSE)); row[6]= strdup_root(alloc, buff); /* BUFFER_LENGTH */ @@ -1490,7 +1490,7 @@ row[3]= strdup_root(alloc,buff); sprintf(buff,"%d",type); row[2]= strdup_root(alloc,buff); - sprintf(buff, "%ld", get_column_size(stmt, field, FALSE)); + sprintf(buff, "%u", get_column_size(stmt, field, FALSE)); row[4]= strdup_root(alloc,buff); sprintf(buff, "%ld", get_transfer_octet_length(stmt, field)); row[5]= strdup_root(alloc,buff); @@ -1566,7 +1566,7 @@ row[3]= strdup_root(alloc,buff); sprintf(buff,"%d",type); row[2]= strdup_root(alloc,buff); - sprintf(buff,"%ld", get_column_size(stmt, field, FALSE)); + sprintf(buff,"%u", get_column_size(stmt, field, FALSE)); row[4]= strdup_root(alloc,buff); sprintf(buff,"%ld", get_transfer_octet_length(stmt, field)); row[5]= strdup_root(alloc,buff); Index: driver/myutil.h =================================================================== --- driver/myutil.h (revision 1020) +++ driver/myutil.h (working copy) @@ -144,7 +144,7 @@ void translate_error(char *save_state,myodbc_errid errid,uint mysql_err); SQLSMALLINT get_sql_data_type(STMT *stmt, MYSQL_FIELD *field, char *buff); -SQLLEN get_column_size(STMT *stmt, MYSQL_FIELD *field, my_bool actual); +SQLULEN get_column_size(STMT *stmt, MYSQL_FIELD *field, my_bool actual); SQLLEN get_decimal_digits(STMT *stmt, MYSQL_FIELD *field); SQLLEN get_transfer_octet_length(STMT *stmt, MYSQL_FIELD *field); SQLLEN get_display_size(STMT *stmt, MYSQL_FIELD *field); Index: test/my_catalog.c =================================================================== --- test/my_catalog.c (revision 1021) +++ test/my_catalog.c (working copy) @@ -1156,10 +1156,8 @@ ok_stmt(hstmt1, SQLGetData(hstmt1, 7, SQL_C_ULONG, &length, sizeof(SQLULEN), NULL)); is_num(length, 2147483647); - ok_stmt(hstmt1, SQLFreeStmt(hstmt1, SQL_CLOSE)); - ok_con(hdbc1, SQLDisconnect(hdbc1)); - ok_con(hdbc1, SQLFreeConnect(hdbc1)); + free_basic_handles(&henv1, &hdbc1, &hstmt1); /* Check without the 32-bit signed flag */ ok_stmt(hstmt, SQLColumns(hstmt, NULL, 0, NULL, 0, @@ -1173,6 +1171,7 @@ ok_stmt(hstmt, SQLFreeStmt(hstmt, SQL_CLOSE)); ok_sql(hstmt, "DROP TABLE bug12805"); + SET_DSN_OPTION(0); return OK; } @@ -1200,6 +1199,7 @@ ADD_TEST(t_bug26934) ADD_TEST(t_bug29888) ADD_TEST(t_bug14407) + ADD_TEST(t_bug12805) END_TESTS