Commit 41dd2aa2 authored by unknown's avatar unknown

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
parent 82a404d9
......@@ -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
......@@ -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)
......
......@@ -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');
......
......@@ -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;
......
......@@ -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)))
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment