diff options
author | unknown <monty@hundin.mysql.fi> | 2002-09-25 20:48:32 +0300 |
---|---|---|
committer | unknown <monty@hundin.mysql.fi> | 2002-09-25 20:48:32 +0300 |
commit | d90b030c7b0866464d5a02802fd49e5889bf1468 (patch) | |
tree | d801141806d36de566e460cfeb10f1776b01246c | |
parent | 2384ead5aaa5344134ba1b5cad865f88d9d0f7da (diff) | |
parent | d77ab077d9d2551e3f35b76caef78e9d41b01d3d (diff) | |
download | mariadb-git-d90b030c7b0866464d5a02802fd49e5889bf1468.tar.gz |
Merge
Docs/manual.texi:
SCCS merged
-rw-r--r-- | Docs/manual.texi | 6 | ||||
-rw-r--r-- | sql/sql_acl.cc | 13 | ||||
-rw-r--r-- | sql/time.cc | 19 |
3 files changed, 31 insertions, 7 deletions
diff --git a/Docs/manual.texi b/Docs/manual.texi index cfb41ebe4be..9db4fc96cbe 100644 --- a/Docs/manual.texi +++ b/Docs/manual.texi @@ -50453,6 +50453,12 @@ each individual 4.0.x release. @itemize @bullet @item +Fixed bug where @code{GRANT}/@code{REVOKE} failed if hostname was given in +not matching case. +@item +Don't give warning in @code{LOAD DATA INFILE} when setting a +@code{timestamp} to a string of '0'. +@item Fixed bug in @code{myisamchk -R} mode. @item Fixed bug that caused @code{mysqld} to crash on @code{REVOKE}. diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index 04a3915d457..867163be90d 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -643,7 +643,8 @@ static void acl_update_user(const char *user, const char *host, !strcmp(user,acl_user->user)) { if (!acl_user->host.hostname && !host[0] || - acl_user->host.hostname && !strcmp(host,acl_user->host.hostname)) + acl_user->host.hostname && + !my_strcasecmp(host,acl_user->host.hostname)) { acl_user->access=privileges; if (mqh->bits & 1) @@ -732,7 +733,7 @@ static void acl_update_db(const char *user, const char *host, const char *db, !strcmp(user,acl_db->user)) { if (!acl_db->host.hostname && !host[0] || - acl_db->host.hostname && !strcmp(host,acl_db->host.hostname)) + acl_db->host.hostname && !my_strcasecmp(host,acl_db->host.hostname)) { if (!acl_db->db && !db[0] || acl_db->db && !strcmp(db,acl_db->db)) @@ -1666,7 +1667,7 @@ static GRANT_TABLE *table_hash_search(const char *host,const char* ip, { if (exact) { - if ((host && !strcmp(host,grant_table->host)) || + if ((host && !my_strcasecmp(host,grant_table->host)) || (ip && !strcmp(ip,grant_table->host))) return grant_table; } @@ -2723,7 +2724,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) if (!(host=acl_user->host.hostname)) host="%"; if (!strcmp(lex_user->user.str,user) && - !strcmp(lex_user->host.str,host)) + !my_strcasecmp(lex_user->host.str,host)) break; } if (counter == acl_users.elements) @@ -2870,7 +2871,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) host=""; if (!strcmp(lex_user->user.str,user) && - !strcmp(lex_user->host.str,host)) + !my_strcasecmp(lex_user->host.str,host)) { want_access=acl_db->access; if (want_access) @@ -2929,7 +2930,7 @@ int mysql_show_grants(THD *thd,LEX_USER *lex_user) host=""; if (!strcmp(lex_user->user.str,user) && - !strcmp(lex_user->host.str,host)) + !my_strcasecmp(lex_user->host.str,host)) { want_access=grant_table->privs; if ((want_access | grant_table->cols) != 0) diff --git a/sql/time.cc b/sql/time.cc index 1597368908d..4fe79966404 100644 --- a/sql/time.cc +++ b/sql/time.cc @@ -429,6 +429,7 @@ timestamp_type str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) { uint field_length,year_length,digits,i,number_of_fields,date[7]; + uint not_zero_date; const char *pos; const char *end=str+length; DBUG_ENTER("str_to_TIME"); @@ -446,6 +447,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) digits= (uint) (pos-str); year_length= (digits == 4 || digits == 8 || digits >= 14) ? 4 : 2; field_length=year_length-1; + not_zero_date= 0; for (i=0 ; i < 6 && str != end && isdigit(*str) ; i++) { uint tmp_value=(uint) (uchar) (*str++ - '0'); @@ -455,6 +457,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) str++; } date[i]=tmp_value; + not_zero_date|= tmp_value; if (i == 2 && str != end && *str == 'T') str++; // ISO8601: CCYYMMDDThhmmss else if ( i != 5 ) // Skip inter-field delimiters @@ -478,6 +481,7 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) while (str++ != end && isdigit(str[0]) && field_length--) tmp_value=tmp_value*10 + (uint) (uchar) (*str - '0'); date[6]=tmp_value; + not_zero_date|= tmp_value; } else date[6]=0; @@ -491,7 +495,20 @@ str_to_TIME(const char *str, uint length, TIME *l_time,bool fuzzy_date) date[2] > 31 || date[3] > 23 || date[4] > 59 || date[5] > 59 || !fuzzy_date && (date[1] == 0 || date[2] == 0)) { - current_thd->cuted_fields++; + /* Only give warning for a zero date if there is some garbage after */ + if (!not_zero_date) // If zero date + { + for (; str != end ; str++) + { + if (!isspace(*str)) + { + not_zero_date= 1; // Give warning + break; + } + } + } + if (not_zero_date) + current_thd->cuted_fields++; DBUG_RETURN(TIMESTAMP_NONE); } if (str != end && current_thd->count_cuted_fields) |