diff options
author | unknown <monty@mysql.com> | 2003-11-28 14:23:54 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2003-11-28 14:23:54 +0200 |
commit | 0444a2a90b6080697e2b28983fdff1110e18f598 (patch) | |
tree | 48ab6a8a0dff816ab7be757cabb3374a2c8f8065 /sql-common | |
parent | ca79326ecc2ab8b13162bb370a547921769cfb81 (diff) | |
parent | 62bd269a6ec00365f39da9ead2b285ea0aabe469 (diff) | |
download | mariadb-git-0444a2a90b6080697e2b28983fdff1110e18f598.tar.gz |
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/my/mysql-4.1
sql-common/client.c:
Auto merged
Diffstat (limited to 'sql-common')
-rw-r--r-- | sql-common/client.c | 9 | ||||
-rw-r--r-- | sql-common/pack.c | 23 |
2 files changed, 27 insertions, 5 deletions
diff --git a/sql-common/client.c b/sql-common/client.c index 6b99b3424ea..7794173b4d0 100644 --- a/sql-common/client.c +++ b/sql-common/client.c @@ -1238,7 +1238,8 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields, { mysql->warning_count= uint2korr(cp+1); mysql->server_status= uint2korr(cp+3); - DBUG_PRINT("info",("warning_count: %ld", mysql->warning_count)); + DBUG_PRINT("info",("status: %u warning_count: %u", + mysql->server_status, mysql->warning_count)); } DBUG_PRINT("exit",("Got %d rows",result->rows)); DBUG_RETURN(result); @@ -2262,6 +2263,9 @@ get_info: { mysql->affected_rows= net_field_length_ll(&pos); mysql->insert_id= net_field_length_ll(&pos); + DBUG_PRINT("info",("affected_rows: %lu insert_id: %lu", + (ulong) mysql->affected_rows, + (ulong) mysql->insert_id)); if (protocol_41(mysql)) { mysql->server_status=uint2korr(pos); pos+=2; @@ -2269,10 +2273,11 @@ get_info: } else if (mysql->server_capabilities & CLIENT_TRANSACTIONS) { + /* MySQL 4.0 protocol */ mysql->server_status=uint2korr(pos); pos+=2; mysql->warning_count= 0; } - DBUG_PRINT("info",("status: %ld warning_count: %ld", + DBUG_PRINT("info",("status: %u warning_count: %u", mysql->server_status, mysql->warning_count)); if (pos < mysql->net.read_pos+length && net_field_length(&pos)) mysql->info=(char*) pos; diff --git a/sql-common/pack.c b/sql-common/pack.c index e31e596ae7a..ed79143a04b 100644 --- a/sql-common/pack.c +++ b/sql-common/pack.c @@ -78,23 +78,40 @@ my_ulonglong net_field_length_ll(uchar **packet) #endif } +/* + Store an integer with simple packing into a output package + + SYNOPSIS + net_store_length() + pkg Store the packed integer here + length integers to store + + NOTES + This is mostly used to store lengths of strings. + We have to cast the result for the LL() becasue of a bug in Forte CC + compiler. + + RETURN + Position in 'pkg' after the packed length +*/ + char * net_store_length(char *pkg, ulonglong length) { uchar *packet=(uchar*) pkg; - if (length < LL(251)) + if (length < (ulonglong) LL(251)) { *packet=(uchar) length; return (char*) packet+1; } /* 251 is reserved for NULL */ - if (length < LL(65536)) + if (length < (ulonglong) LL(65536)) { *packet++=252; int2store(packet,(uint) length); return (char*) packet+2; } - if (length < LL(16777216)) + if (length < (ulonglong) LL(16777216)) { *packet++=253; int3store(packet,(ulong) length); |