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

Manual merge

This commit is contained in:
igor@rurik.mysql.com
2005-06-23 11:22:30 -07:00
9 changed files with 273 additions and 30 deletions

View File

@ -448,6 +448,7 @@ class store_key :public Sql_alloc
char *null_ptr;
char err;
public:
enum store_key_result { STORE_KEY_OK, STORE_KEY_FATAL, STORE_KEY_CONV };
store_key(THD *thd, Field *field_arg, char *ptr, char *null, uint length)
:null_ptr(null),err(0)
{
@ -463,7 +464,7 @@ class store_key :public Sql_alloc
ptr, (uchar*) null, 1);
}
virtual ~store_key() {} /* Not actually needed */
virtual bool copy()=0;
virtual enum store_key_result copy()=0;
virtual const char *name() const=0;
};
@ -484,10 +485,10 @@ class store_key_field: public store_key
copy_field.set(to_field,from_field,0);
}
}
bool copy()
enum store_key_result copy()
{
copy_field.do_copy(&copy_field);
return err != 0;
return err != 0 ? STORE_KEY_FATAL : STORE_KEY_OK;
}
const char *name() const { return field_name; }
};
@ -504,9 +505,11 @@ public:
null_ptr_arg ? null_ptr_arg : item_arg->maybe_null ?
&err : NullS, length), item(item_arg)
{}
bool copy()
enum store_key_result copy()
{
return item->save_in_field_no_warnings(to_field, 1) || err != 0;
int res= item->save_in_field(to_field, 1);
return (err != 0 || res > 2 ? STORE_KEY_FATAL : (store_key_result) res);
}
const char *name() const { return "func"; }
};
@ -524,15 +527,19 @@ public:
&err : NullS, length, item_arg), inited(0)
{
}
bool copy()
enum store_key_result copy()
{
int res;
if (!inited)
{
inited=1;
if (item->save_in_field(to_field, 1))
err= 1;
if ((res= item->save_in_field(to_field, 1)))
{
if (!err)
err= res;
}
}
return err != 0;
return (err > 2 ? STORE_KEY_FATAL : (store_key_result) err);
}
const char *name() const { return "const"; }
};