diff options
author | unknown <monty@donna.mysql.fi> | 2001-05-23 02:40:24 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.fi> | 2001-05-23 02:40:24 +0300 |
commit | 41dd2aa2b5a2f8b7a5d760bff26e8ceb2ce10fff (patch) | |
tree | 089c3177d314fd343965d105d3f57b5fe995b5a4 | |
parent | 82a404d9fb1e3d181033473183be2e48d9ee406a (diff) | |
download | mariadb-git-41dd2aa2b5a2f8b7a5d760bff26e8ceb2ce10fff.tar.gz |
Remove wrong access check for locks.
Fixed problem with fuzzy dates.
mysql-test/r/func_time.result:
Added test of fuzzy dates
mysql-test/t/func_time.test:
Added test of fuzzy dates
sql/item.cc:
Fixed bug with fuzzy dates
sql/sql_parse.cc:
Remove wrong access check for locks.
(This has to be delayed for 4.0 because there is currently now way
to check for "any of the following privileges"
Docs/manual.texi:
Changelog
-rw-r--r-- | Docs/manual.texi | 3 | ||||
-rw-r--r-- | mysql-test/r/func_time.result | 4 | ||||
-rw-r--r-- | mysql-test/t/func_time.test | 2 | ||||
-rw-r--r-- | sql/item.cc | 2 | ||||
-rw-r--r-- | sql/sql_parse.cc | 9 |
5 files changed, 10 insertions, 10 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index 93d4f1c377d..da569c67dd1 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -44538,6 +44538,9 @@ not yet 100% confident in this code. @appendixsubsec Changes in release 3.23.39 @itemize @bullet @item +Fixed that date-part extract functions works with dates where day +and/or month is 0. +@item Extended argument length in option files from 256 to 512 chars. @item Fixed problem with shutdown when @code{INSERT DELAYED} was waiting for diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index a24dc044a9a..fd7c6897574 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -20,6 +20,8 @@ dayofmonth("1997-01-02") dayofmonth(19970323) 2 23 month("1997-01-02") year("98-02-03") dayofyear("1997-12-31") 1 1998 365 +month("2001-02-00") year("2001-00-00") +2 2001 DAYOFYEAR("1997-03-03") WEEK("1998-03-03") QUARTER(980303) 62 9 1 HOUR("1997-03-03 23:03:22") MINUTE("23:03:22") SECOND(230322) @@ -184,6 +186,8 @@ extract(MINUTE_SECOND FROM "10:11:12") 1112 extract(SECOND FROM "1999-01-02 10:11:12") 12 +extract(MONTH FROM "2001-02-00") +2 ctime hour(ctime) 2001-01-12 12:23:40 12 monthname(date) diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index 062cbea9f84..a91844ab986 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -14,6 +14,7 @@ select date_format("1997-01-02 03:04:05", "%M %W %D %Y %y %m %d %h %i %s %w"); select date_format("1997-01-02", concat("%M %W %D ","%Y %y %m %d %h %i %s %w")); select dayofmonth("1997-01-02"),dayofmonth(19970323); select month("1997-01-02"),year("98-02-03"),dayofyear("1997-12-31"); +select month("2001-02-00"),year("2001-00-00"); select DAYOFYEAR("1997-03-03"), WEEK("1998-03-03"), QUARTER(980303); select HOUR("1997-03-03 23:03:22"), MINUTE("23:03:22"), SECOND(230322); select week(19980101),week(19970101),week(19980101,1),week(19970101,1); @@ -100,6 +101,7 @@ select extract(HOUR_SECOND FROM "10:11:12"); select extract(MINUTE FROM "10:11:12"); select extract(MINUTE_SECOND FROM "10:11:12"); select extract(SECOND FROM "1999-01-02 10:11:12"); +select extract(MONTH FROM "2001-02-00"); create table t1 (ctime varchar(20)); insert into t1 values ('2001-01-12 12:23:40'); diff --git a/sql/item.cc b/sql/item.cc index 10d1c6d0560..b268c5eb928 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -75,7 +75,7 @@ bool Item::get_date(TIME *ltime,bool fuzzydate) char buff[40]; String tmp(buff,sizeof(buff)),*res; if (!(res=val_str(&tmp)) || - str_to_TIME(res->ptr(),res->length(),ltime,0) == TIMESTAMP_NONE) + str_to_TIME(res->ptr(),res->length(),ltime,fuzzydate) == TIMESTAMP_NONE) { bzero((char*) ltime,sizeof(*ltime)); return 1; diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index e420918e06d..7a94dc32997 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1851,15 +1851,6 @@ mysql_execute_command(void) } if (check_db_used(thd,tables) || end_active_trans(thd)) goto error; - for (TABLE_LIST *tmp = tables; tmp; tmp = tmp->next) - { - if (!(tmp->lock_type == TL_READ_NO_INSERT ? - !check_table_access(thd, SELECT_ACL, tmp) : - (!check_table_access(thd, INSERT_ACL, tmp) || - !check_table_access(thd, UPDATE_ACL, tmp) || - !check_table_access(thd, DELETE_ACL, tmp)))) - goto error; - } thd->in_lock_tables=1; if (!(res=open_and_lock_tables(thd,tables))) { |