summaryrefslogtreecommitdiff
path: root/sql-common/pack.c
diff options
context:
space:
mode:
authormonty@mysql.com <>2003-11-28 12:18:13 +0200
committermonty@mysql.com <>2003-11-28 12:18:13 +0200
commitede8169d24c56a4e264034b3a098477072532ca5 (patch)
treee5a58d3f07e9cca109d78031822106ff2be7f6f8 /sql-common/pack.c
parent7733969bf65befdbf1fd4445ec6b7efa43b61492 (diff)
downloadmariadb-git-ede8169d24c56a4e264034b3a098477072532ca5.tar.gz
Added missing SSL library (Should be in source distribution)
Fixed compiler warnings (a lot of hidden variables detected by the Forte compiler) Added a lot of 'version_xxx' strings to 'show variables' Prevent copying of TMP_TABLE_PARAM (This caused core dump bug on Solaris) Fixed problem with printing sub selects to debug log
Diffstat (limited to 'sql-common/pack.c')
-rw-r--r--sql-common/pack.c23
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);