summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <konstantin@mysql.com>2005-07-14 20:02:32 +0400
committerunknown <konstantin@mysql.com>2005-07-14 20:02:32 +0400
commit5858a8cd42392832a443e19ce12abb8aabad12e6 (patch)
treef9d3af9a30fe2cd38664ddcef3096d663741dc68 /sql
parent20d8170adc735d49acc95981845ebd0844c00653 (diff)
parent69ecbbcbf31aeb5165c9134d8fa1180f42d91da1 (diff)
downloadmariadb-git-5858a8cd42392832a443e19ce12abb8aabad12e6.tar.gz
Merge mysql.com:/opt/local/work/mysql-4.1-root
into mysql.com:/opt/local/work/mysql-5.0-root mysql-test/r/ps_2myisam.result: Auto merged mysql-test/r/ps_3innodb.result: Auto merged mysql-test/r/ps_4heap.result: Auto merged mysql-test/r/ps_5merge.result: Auto merged mysql-test/r/ps_6bdb.result: Auto merged mysql-test/r/ps_7ndb.result: Auto merged sql/field.cc: manual merge tests/mysql_client_test.c: manual merge mysql-test/r/select.result: manual merge mysql-test/t/select.test: manual merge sql/sql_select.cc: Auto merged sql/item_func.cc: Auto merged
Diffstat (limited to 'sql')
-rw-r--r--sql/field.cc4
-rw-r--r--sql/item_func.cc3
-rw-r--r--sql/sql_select.cc12
3 files changed, 15 insertions, 4 deletions
diff --git a/sql/field.cc b/sql/field.cc
index 925fca8ac43..bb035ce5d37 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -47,6 +47,8 @@ uchar Field_null::null[1]={1};
const char field_separator=',';
#define DOUBLE_TO_STRING_CONVERSION_BUFFER_SIZE 320
+#define BLOB_PACK_LENGTH_TO_MAX_LENGH(arg) \
+((ulong) ((LL(1) << min(arg, 4) * 8) - LL(1)))
/*
Rules for merging different types of fields in UNION
@@ -6696,7 +6698,7 @@ Field_blob::Field_blob(char *ptr_arg, uchar *null_ptr_arg, uchar null_bit_arg,
enum utype unireg_check_arg, const char *field_name_arg,
struct st_table *table_arg,uint blob_pack_length,
CHARSET_INFO *cs)
- :Field_longstr(ptr_arg, (1L << min(blob_pack_length,3)*8)-1L,
+ :Field_longstr(ptr_arg, BLOB_PACK_LENGTH_TO_MAX_LENGH(blob_pack_length),
null_ptr_arg, null_bit_arg, unireg_check_arg, field_name_arg,
table_arg, cs),
packlength(blob_pack_length)
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 296083b256e..ece2fdc4fb0 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -4395,6 +4395,9 @@ bool Item_func_match::fix_index()
if (key == NO_SUCH_KEY)
return 0;
+
+ if (!table)
+ goto err;
for (keynr=0 ; keynr < table->s->keys ; keynr++)
{
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 524fc784422..3d9315a2bd6 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -5169,11 +5169,17 @@ static void add_not_null_conds(JOIN *join)
DBUG_ASSERT(item->type() == Item::FIELD_ITEM);
Item_field *not_null_item= (Item_field*)item;
JOIN_TAB *referred_tab= not_null_item->field->table->reginfo.join_tab;
- Item_func_isnotnull *notnull;
+ Item *notnull;
if (!(notnull= new Item_func_isnotnull(not_null_item)))
DBUG_VOID_RETURN;
-
- notnull->quick_fix_field();
+ /*
+ We need to do full fix_fields() call here in order to have correct
+ notnull->const_item(). This is needed e.g. by test_quick_select
+ when it is called from make_join_select after this function is
+ called.
+ */
+ if (notnull->fix_fields(join->thd, join->tables_list, &notnull))
+ DBUG_VOID_RETURN;
DBUG_EXECUTE("where",print_where(notnull,
referred_tab->table->alias););
add_cond_and_fix(&referred_tab->select_cond, notnull);