1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge 4.1 to 5.0

This commit is contained in:
pem@mysql.com
2003-12-01 16:14:40 +01:00
270 changed files with 4938 additions and 2632 deletions

View File

@ -30,7 +30,7 @@ bool Protocol_cursor::send_fields(List<Item> *list, uint flag)
{
List_iterator_fast<Item> it(*list);
Item *item;
MYSQL_FIELD *field, *client_field;
MYSQL_FIELD *client_field;
DBUG_ENTER("send_fields");
if (prepare_for_send(list))
@ -73,9 +73,9 @@ bool Protocol_cursor::send_fields(List<Item> *list, uint flag)
String tmp(buff, sizeof(buff), default_charset_info), *res;
if (!(res=item->val_str(&tmp)))
client_field->def= strdup_root(alloc, "");
client_field->def= (char*) "";
else
client_field->def= strdup_root(alloc, tmp.ptr());
client_field->def= strmake_root(alloc, res->ptr(), res->length());
}
else
client_field->def=0;
@ -98,23 +98,23 @@ bool Protocol_cursor::write()
MYSQL_FIELD *cur_field= fields;
MYSQL_FIELD *fields_end= fields + field_count;
MYSQL_ROWS *new_record;
byte **data;
byte **data_tmp;
byte *to;
new_record= (MYSQL_ROWS *)alloc_root(alloc,
sizeof(MYSQL_ROWS) + (field_count + 1)*sizeof(char *) + packet->length());
if (!new_record)
goto err;
data= (byte **)(new_record + 1);
new_record->data= (char **)data;
data_tmp= (byte **)(new_record + 1);
new_record->data= (char **)data_tmp;
to= (byte *)data + (field_count + 1)*sizeof(char *);
for (; cur_field < fields_end; ++cur_field, ++data)
for (; cur_field < fields_end; ++cur_field, ++data_tmp)
{
if ((len= net_field_length((uchar **)&cp)) == 0)
{
*data= 0;
*data_tmp= 0;
}
else
{