Bug #58 prepare/bind/fetch fails for smallint -> long
| Submitted: | 5 Feb 2003 13:08 | Modified: | 5 Feb 2003 21:30 |
|---|---|---|---|
| Reporter: | Georg Richter | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | OS: | ||
| Assigned to: | Venu Anuganti | CPU Architecture: | Any |
[5 Feb 2003 21:24]
MySQL Developer
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at http://www.mysql.com/downloads/ It is now fixed and the fix is available from the current BK source.
[5 Feb 2003 21:32]
Venu Anuganti
It is now fixed and the fix is available from the current BK source tree. The tests are also added as test_sshort_bug() and test_stiny_bug() in client_test.c for verification purpose. Thanks
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.050 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: mysql_prepare/bind_result/execute/fetch fails for signed smallint -> long How to repeat: static void test_bug_58() { MYSQL_STMT *stmt; MYSQL_BIND bind[4]; ushort short_value; long long_value; long s_length, l_length, ll_length, t_length; ulonglong longlong_value; int rc; uchar tiny_value; myheader("test_bug_58"); rc= mysql_query(mysql,"DROP TABLE IF EXISTS test_ushort"); myquery(rc); rc= mysql_query(mysql,"CREATE TABLE test_ushort(a smallint signed, \ b smallint signed, \ c smallint unsigned, \ d smallint unsigned)"); myquery(rc); rc= mysql_query(mysql,"INSERT INTO test_ushort VALUES(-5999, -5999, 35999, 200)"); myquery(rc); stmt = mysql_prepare(mysql,"SELECT * FROM test_ushort",50); mystmt_init(stmt); rc = mysql_execute(stmt); mystmt(stmt, rc); bind[0].buffer_type= MYSQL_TYPE_SHORT; bind[0].buffer= (char *)&short_value; bind[0].is_null= 0; bind[0].length= &s_length; bind[1].buffer_type= MYSQL_TYPE_LONG; bind[1].buffer= (char *)&long_value; bind[1].is_null= 0; bind[1].length= &l_length; bind[2].buffer_type= MYSQL_TYPE_LONGLONG; bind[2].buffer= (char *)&longlong_value; bind[2].is_null= 0; bind[2].length= &ll_length; bind[3].buffer_type= MYSQL_TYPE_TINY; bind[3].buffer= (char *)&tiny_value; bind[3].is_null= 0; bind[3].length= &t_length; rc = mysql_bind_result(stmt, bind); mystmt(stmt, rc); rc = mysql_fetch(stmt); mystmt(stmt, rc); fprintf(stdout,"\n ushort: %d (%ld)", short_value, s_length); fprintf(stdout,"\n ulong : %ld (%ld)", long_value, l_length); fprintf(stdout,"\n ulong : %lld (%ld)", longlong_value, ll_length); fprintf(stdout,"\n ulong : %d (%ld)", tiny_value, t_length); myassert(short_value == -5999); myassert(s_length == 2); myassert(long_value == -5999); myassert(l_length == 4); myassert(longlong_value == 35999); myassert(ll_length == 8); myassert(tiny_value == 200); myassert(t_length == 1); rc = mysql_fetch(stmt); myassert(rc == MYSQL_NO_DATA); mysql_stmt_close(stmt); }