diff options
author | unknown <monty@mysql.com> | 2003-11-28 13:31:38 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2003-11-28 13:31:38 +0200 |
commit | ef43220170521a90454c05380cc01d562fc98c2f (patch) | |
tree | 995a8061976a12fd5dfb02679e683b86c743879c /sql-common/pack.c | |
parent | 03092d0c24067bf97359436e49e6cce7ca0e2803 (diff) | |
parent | 183b02a8ac6074775bd8c33f036eed3cf6597bbe (diff) | |
download | mariadb-git-ef43220170521a90454c05380cc01d562fc98c2f.tar.gz |
Merge
sql/sql_parse.cc:
Auto merged
sql-common/client.c:
Auto merged
sql/sql_derived.cc:
keep local copy
sql/sql_union.cc:
keep local copy
Diffstat (limited to 'sql-common/pack.c')
-rw-r--r-- | sql-common/pack.c | 23 |
1 files changed, 20 insertions, 3 deletions
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); |