~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 1 16 years ago brian clean slate Diff
config 1 16 years ago brian clean slate Diff
drizzled 214 16 years ago Brian Aker Rename of fields (fix issue with string and decima Diff
extra 1 16 years ago brian clean slate Diff
gnulib 815.1.1 16 years ago Monty Taylor Add timegm which is missing on Solaris. Diff
libdrizzleclient 779.3.37 16 years ago Monty Taylor Renmaed libdrizzle in the tree to libdrizzleclient Diff
m4 202.3.14 16 years ago Monty Taylor Moved m4 macros to top-level m4 dir, per GNU stand Diff
mystrings 212.5.4 16 years ago Monty Taylor Renamed strings to mystrings, for include/lib nami Diff
mysys 1 16 years ago brian clean slate Diff
plugin 1 16 years ago brian clean slate Diff
po 202.3.1 16 years ago Monty Taylor Added very initial gettextize stuff. Diff
storage 1 16 years ago brian clean slate Diff
support-files 1 16 years ago brian clean slate Diff
tests 77.1.47 16 years ago Monty Taylor Moved test to tests... Diff
.bzrignore 850 16 years ago Brian Aker More class creation. 4.8 KB Diff Download File
ABOUT-NLS 202.3.1 16 years ago Monty Taylor Added very initial gettextize stuff. 74.7 KB Diff Download File
AUTHORS 492.3.36 16 years ago Lee add my name to the AUTHORS file 358 bytes Diff Download File
configure.ac 859.1.8 16 years ago Monty Taylor Fixed solaris prefetch patch. 44.2 KB Diff Download File
COPYING 1 16 years ago brian clean slate 18.6 KB Diff Download File
Doxyfile 264.3.1 16 years ago Jay Pipes * Added Doxyfile configuration for doxygen builds 55.2 KB Diff Download File
DRIZZLE.FAQ 665.1.4 16 years ago Eric Herman Added pointer to online version of the FAQ 5.8 KB Diff Download File
EXCEPTIONS-CLIENT 1 16 years ago brian clean slate 5 KB Diff Download File
Makefile.am 859.1.2 16 years ago Monty Taylor Let's not remove po/POTFILES.in, hrm? 5 KB Diff Download File
NEWS 194 16 years ago Brian Aker Documentation cleanup 41 bytes Diff Download File
README 665.1.3 16 years ago Eric Herman added some essential notes to the README 749 bytes Diff Download File