~drizzle-trunk/drizzle/development

  • Committer: Jay Pipes
  • Date: 2009-02-11 21:38:28 UTC
  • Revision ID: jpipes@serialcoder-20090211213828-zpiv58fdoz3ryybs
Fixes Field_datetime::store(NUMBER) to throw an error when invalid
date time numbers are passed through.

This fix illuminated a bug in the optimizer, where the following:

CREATE TABLE t1 (d datetime NOT NULL);
SELECT * FROM t1 WHERE d IS NULL;

was producing an incorrect query plan.  The reason is because the optimizer
was incorrectly reducing an Item_func_isnull to an Item_int with a value of
0.  In MySQL, the optimizer compares datetimes as integers, and *just in the
optimizer*, ignores bad datetimes so that it can do this comparison.  Unfortunately
for MySQL, what this means is that the optimizer cannot optimize away the 
above IS NULL condition because it converts the NULL to a 0000-00-00 00:00:00.

Drizzle's optimizer now shows an impossible WHERE reduction in the explain
output for the above query, which is optimal.

Also fixed an assert that was occurring in mysql_alter_table because that
function called fix_fields() which ignores data truncation errors improperly and
mysql_alter_table ignores the errors as well, which led to an assertion failure
in Diagnostics_area::send_ok_status() because mysql_alter_table() assumes
that all errors would be logged as only warnings from Field::store().

Also contained in this patch is corrections for invalid numeric datetime input
for all test cases affected.
Filename Latest Rev Last Changed Committer Comment Size
..
client_priv.h 779.3.37 16 years ago Monty Taylor Renmaed libdrizzle in the tree to libdrizzleclient 3.5 KB Diff Download File
completion_hash.cc 477 16 years ago Monty Taylor Removed my_free(). It turns out that it had been d 4.5 KB Diff Download File
completion_hash.h 212.5.13 16 years ago Monty Taylor Moved my_sys/my_pthread/my_nosys and mysys_err to 1.9 KB Diff Download File
drizzle.cc 862 16 years ago Brian Aker Remove charset directory code. 123 KB Diff Download File
drizzleadmin.cc 840.1.21 16 years ago Monty Taylor ZOMG. Renamed all the rest of the stuff in libdriz 11.3 KB Diff Download File
drizzlecheck.cc 862 16 years ago Brian Aker Remove charset directory code. 26 KB Diff Download File
drizzledump.cc 862 16 years ago Brian Aker Remove charset directory code. 97.1 KB Diff Download File
drizzleimport.cc 862 16 years ago Brian Aker Remove charset directory code. 20.4 KB Diff Download File
drizzleslap.cc 840.1.21 16 years ago Monty Taylor ZOMG. Renamed all the rest of the stuff in libdriz 76.6 KB Diff Download File
drizzletest.cc 859.1.6 16 years ago Monty Taylor Fix for multi-versions of PCRE thing. 181 KB Diff Download File
errname.h 383.7.6 16 years ago Monty Taylor Merged in trunk. 26.8 KB Diff Download File
Makefile.am 840.1.9 16 years ago Monty Taylor Merged from me. 1.6 KB Diff Download File
my_readline.h 779.2.4 16 years ago Monty Taylor Updated some more build stuff. 1.2 KB Diff Download File
readline.cc 656.1.50 16 years ago Monty Taylor More malloc return type checking 5.8 KB Diff Download File