summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Docs/manual.texi4
-rw-r--r--mysql-test/r/create.result2
-rw-r--r--mysql-test/t/create.test2
-rw-r--r--sql/item_func.h5
-rw-r--r--sql/item_timefunc.h5
-rw-r--r--sql/sql_acl.cc2
6 files changed, 15 insertions, 5 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi
index 5a7e8bb739f..6d3f65a16c2 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -50132,6 +50132,10 @@ each individual 4.0.x release.
@itemize @bullet
@item
+Fixed security bug in database hash
+@item
+Fixed create table from any ITEM_FUNC and reverted a patch for month()
+@item
Fixed bug in multi-table update when updating a table confused do_select
in reading records from a cache
@item
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index ef44e840a79..71044065dad 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -134,3 +134,5 @@ t1 CREATE TABLE `t1` (
KEY `b_31` (`b`)
) TYPE=MyISAM
drop table t1;
+create table t1 select if(1,'1','0'), month("2002-08-02");
+drop table t1;
diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test
index 99d4e5ae229..7e924e9f262 100644
--- a/mysql-test/t/create.test
+++ b/mysql-test/t/create.test
@@ -89,3 +89,5 @@ drop table t1,t2;
create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));
show create table t1;
drop table t1;
+create table t1 select if(1,'1','0'), month("2002-08-02");
+drop table t1;
diff --git a/sql/item_func.h b/sql/item_func.h
index 6c0c2cda06d..55df736d35b 100644
--- a/sql/item_func.h
+++ b/sql/item_func.h
@@ -122,6 +122,11 @@ public:
bool is_null() { (void) val_int(); return null_value; }
friend class udf_handler;
unsigned int size_of() { return sizeof(*this);}
+ Field *tmp_table_field(TABLE *t_arg)
+ {
+ if (!t_arg) return result_field;
+ return (Field *) new Field_string(max_length,maybe_null, name,t_arg, binary);
+ }
};
diff --git a/sql/item_timefunc.h b/sql/item_timefunc.h
index d867433ef91..6b0d1850d8c 100644
--- a/sql/item_timefunc.h
+++ b/sql/item_timefunc.h
@@ -71,11 +71,6 @@ public:
const char *func_name() const { return "month"; }
enum Item_result result_type () const { return INT_RESULT; }
void fix_length_and_dec() { decimals=0; max_length=2; maybe_null=1; }
- Field *tmp_table_field(TABLE *t_arg)
- {
- if (!t_arg) return result_field;
- return (Field *) new Field_string(max_length,maybe_null, name,t_arg, binary);
- }
};
class Item_func_monthname :public Item_func_month
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index e5abd5ce8a7..656660437af 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -321,6 +321,8 @@ int acl_init(bool dont_read_acl_tables)
ACL_DB db;
update_hostname(&db.host,get_field(&mem, table,0));
db.db=get_field(&mem, table,1);
+ if (!db.db || !db.db[0])
+ continue;
db.user=get_field(&mem, table,2);
db.access=get_access(table,3);
db.access=fix_rights_for_db(db.access);