Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
12ac759d
Commit
12ac759d
authored
Sep 25, 2002
by
monty@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Compare hostnames case insensitive
Accept zero dates without warnings
parent
5165a94b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
7 deletions
+31
-7
Docs/manual.texi
Docs/manual.texi
+6
-0
sql/sql_acl.cc
sql/sql_acl.cc
+7
-6
sql/time.cc
sql/time.cc
+18
-1
No files found.
Docs/manual.texi
View file @
12ac759d
...
...
@@ -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
One didn't get an error message if mysqld couldn't open the privilege tables.
@item
@code{SET PASSWORD FOR ...} closed the connection in case of errors (bug
sql/sql_acl.cc
View file @
12ac759d
...
...
@@ -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
&&
!
str
cmp
(
host
,
acl_db
->
host
.
hostname
))
acl_db
->
host
.
hostname
&&
!
my_strcase
cmp
(
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
&&
!
str
cmp
(
host
,
grant_table
->
host
))
||
if
((
host
&&
!
my_strcase
cmp
(
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
)
&&
!
str
cmp
(
lex_user
->
host
.
str
,
host
))
!
my_strcase
cmp
(
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
)
&&
!
str
cmp
(
lex_user
->
host
.
str
,
host
))
!
my_strcase
cmp
(
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
)
&&
!
str
cmp
(
lex_user
->
host
.
str
,
host
))
!
my_strcase
cmp
(
lex_user
->
host
.
str
,
host
))
{
want_access
=
grant_table
->
privs
;
if
((
want_access
|
grant_table
->
cols
)
!=
0
)
...
...
sql/time.cc
View file @
12ac759d
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment