mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
SCRUM
Protocol_cursor class and sql-common/ directory Makefile.am: pack.c added to linked sources include/mysql.h: net_field_length_ll declaration added include/mysql_com.h: net_field_length declaration added libmysql/Makefile.am: sql-common files symlinked libmysql/Makefile.shared: pack.lo target added libmysql/libmysql.c: net_field_length removed from here sql/Makefile.am: pack.c added to the sources sql/mini_client.cc: mc_net_field_length functions replaced with net_field_length sql/protocol.h: Protocol_cursor class added
This commit is contained in:
@ -36,6 +36,7 @@ link_sources:
|
||||
ds=`echo $(dbugobjects) | sed "s;\.lo;.c;g"`; \
|
||||
ms=`echo $(mysysobjects) | sed "s;\.lo;.c;g"`; \
|
||||
vs=`echo $(vio_objects) | sed "s;\.lo;.c;g"`; \
|
||||
scs=`echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"`; \
|
||||
for f in $$ss; do \
|
||||
rm -f $(srcdir)/$$f; \
|
||||
@LN_CP_F@ $(srcdir)/../strings/$$f $(srcdir)/$$f; \
|
||||
@ -44,6 +45,10 @@ link_sources:
|
||||
rm -f $(srcdir)/$$f; \
|
||||
@LN_CP_F@ $(srcdir)/../vio/$$f $(srcdir)/$$f; \
|
||||
done; \
|
||||
for f in $$scs; do \
|
||||
rm -f $(srcdir)/$$f; \
|
||||
@LN_CP_F@ $(srcdir)/../sql-common/$$f $(srcdir)/$$f; \
|
||||
done; \
|
||||
for f in $(mystringsextra); do \
|
||||
rm -f $(srcdir)/$$f; \
|
||||
@LN_CP_F@ $(srcdir)/../strings/$$f $(srcdir)/$$f; \
|
||||
|
@ -63,12 +63,13 @@ mysysobjects1 = my_init.lo my_static.lo my_malloc.lo my_realloc.lo \
|
||||
my_pread.lo mf_cache.lo md5.lo sha1.lo\
|
||||
my_getopt.lo my_gethostbyname.lo my_port.lo
|
||||
sqlobjects = net.lo
|
||||
sql_cmn_objects = pack.lo
|
||||
|
||||
# Not needed in the minimum library
|
||||
mysysobjects2 = my_lib.lo
|
||||
mysysobjects = $(mysysobjects1) $(mysysobjects2)
|
||||
target_libadd = $(mysysobjects) $(mystringsobjects) $(dbugobjects) \
|
||||
$(vio_objects) $(sqlobjects)
|
||||
$(sql_cmn_objects) $(vio_objects) $(sqlobjects)
|
||||
target_ldflags = -version-info @SHARED_LIB_VERSION@
|
||||
vio_objects= vio.lo viosocket.lo viossl.lo viosslfactories.lo
|
||||
CLEANFILES = $(target_libadd) $(SHLIBOBJS) \
|
||||
@ -85,6 +86,7 @@ clean-local:
|
||||
`echo $(dbugobjects) | sed "s;\.lo;.c;g"` \
|
||||
`echo $(mysysobjects) | sed "s;\.lo;.c;g"` \
|
||||
`echo $(vio_objects) | sed "s;\.lo;.c;g"` \
|
||||
`echo $(sql_cmn_objects) | sed "s;\.lo;.c;g"` \
|
||||
$(CHARSET_SRCS) $(CHARSET_OBJS) \
|
||||
$(mystringsextra) $(mysysheaders) \
|
||||
../linked_client_sources net.c
|
||||
|
@ -612,71 +612,6 @@ net_safe_read(MYSQL *mysql)
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
/* Get the length of next field. Change parameter to point at fieldstart */
|
||||
static ulong
|
||||
net_field_length(uchar **packet)
|
||||
{
|
||||
reg1 uchar *pos= *packet;
|
||||
if (*pos < 251)
|
||||
{
|
||||
(*packet)++;
|
||||
return (ulong) *pos;
|
||||
}
|
||||
if (*pos == 251)
|
||||
{
|
||||
(*packet)++;
|
||||
return NULL_LENGTH;
|
||||
}
|
||||
if (*pos == 252)
|
||||
{
|
||||
(*packet)+=3;
|
||||
return (ulong) uint2korr(pos+1);
|
||||
}
|
||||
if (*pos == 253)
|
||||
{
|
||||
(*packet)+=4;
|
||||
return (ulong) uint3korr(pos+1);
|
||||
}
|
||||
(*packet)+=9; /* Must be 254 when here */
|
||||
return (ulong) uint4korr(pos+1);
|
||||
}
|
||||
|
||||
/* Same as above, but returns ulonglong values */
|
||||
|
||||
static my_ulonglong
|
||||
net_field_length_ll(uchar **packet)
|
||||
{
|
||||
reg1 uchar *pos= *packet;
|
||||
if (*pos < 251)
|
||||
{
|
||||
(*packet)++;
|
||||
return (my_ulonglong) *pos;
|
||||
}
|
||||
if (*pos == 251)
|
||||
{
|
||||
(*packet)++;
|
||||
return (my_ulonglong) NULL_LENGTH;
|
||||
}
|
||||
if (*pos == 252)
|
||||
{
|
||||
(*packet)+=3;
|
||||
return (my_ulonglong) uint2korr(pos+1);
|
||||
}
|
||||
if (*pos == 253)
|
||||
{
|
||||
(*packet)+=4;
|
||||
return (my_ulonglong) uint3korr(pos+1);
|
||||
}
|
||||
(*packet)+=9; /* Must be 254 when here */
|
||||
#ifdef NO_CLIENT_LONGLONG
|
||||
return (my_ulonglong) uint4korr(pos+1);
|
||||
#else
|
||||
return (my_ulonglong) uint8korr(pos+1);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
static void free_rows(MYSQL_DATA *cur)
|
||||
{
|
||||
if (cur)
|
||||
@ -1388,7 +1323,8 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
|
||||
{
|
||||
uint field;
|
||||
ulong pkt_len,len;
|
||||
uchar *pos,*prev_pos, *end_pos;
|
||||
uchar *pos, *end_pos;
|
||||
uchar *prev_pos;
|
||||
|
||||
if ((pkt_len=net_safe_read(mysql)) == packet_error)
|
||||
return -1;
|
||||
@ -1422,7 +1358,7 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
|
||||
}
|
||||
if (prev_pos)
|
||||
*prev_pos=0; /* Terminate prev field */
|
||||
prev_pos=pos;
|
||||
prev_pos= pos;
|
||||
}
|
||||
row[field]=(char*) prev_pos+1; /* End of last field */
|
||||
*prev_pos=0; /* Terminate last field */
|
||||
@ -5009,7 +4945,7 @@ static void fetch_results(MYSQL_BIND *param, uint field_type, uchar **row,
|
||||
{
|
||||
MYSQL_TIME tm;
|
||||
|
||||
length= read_binary_date(&tm,row);
|
||||
length= read_binary_date(&tm, row);
|
||||
tm.time_type= MYSQL_TIMESTAMP_DATE;
|
||||
send_data_time(param, tm, length);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user