1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

func_str.result, func_str.test:

Added a test case for bug #10124.
sql_select.h, item_subselect.cc, sql_select.cc:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
field.cc:
  Fixed bug #10124.
  When ussuing a warning the store methods return 2 instead of 1 now.


sql/field.cc:
  Fixed bug #10124.
  When ussuing a warning the store methods return 2 instead of 1 now.
sql/sql_select.cc:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
sql/item_subselect.cc:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
sql/sql_select.h:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
mysql-test/t/func_str.test:
  Added a test case for bug #10124.
mysql-test/r/func_str.result:
  Added a test case for bug #10124.
This commit is contained in:
unknown
2005-06-23 06:15:50 -07:00
parent ff972e3e5d
commit 98253bd64d
6 changed files with 73 additions and 30 deletions

View File

@ -356,6 +356,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)
{
@ -371,7 +372,7 @@ class store_key :public Sql_alloc
}
}
virtual ~store_key() {} /* Not actually needed */
virtual bool copy()=0;
virtual enum store_key_result copy()=0;
virtual const char *name() const=0;
};
@ -392,10 +393,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; }
};
@ -412,9 +413,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(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"; }
};
@ -432,15 +435,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"; }
};