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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
f140575e
Commit
f140575e
authored
Oct 02, 2008
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
42e48bc4
d51e2c07
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
2 deletions
+41
-2
mysql-test/r/create.result
mysql-test/r/create.result
+2
-0
mysql-test/t/create.test
mysql-test/t/create.test
+5
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_parse.cc
sql/sql_parse.cc
+32
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+1
-2
No files found.
mysql-test/r/create.result
View file @
f140575e
...
@@ -1546,6 +1546,8 @@ SHOW INDEX FROM t1;
...
@@ -1546,6 +1546,8 @@ SHOW INDEX FROM t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 c1 1 c1 A NULL NULL NULL YES BTREE
t1 1 c1 1 c1 A NULL NULL NULL YES BTREE
DROP TABLE t1;
DROP TABLE t1;
create user mysqltest_1@'test@test';
ERROR HY000: Malformed hostname (illegal symbol: '@')
CREATE TABLE t1 (a INTEGER AUTO_INCREMENT PRIMARY KEY, b INTEGER NOT NULL);
CREATE TABLE t1 (a INTEGER AUTO_INCREMENT PRIMARY KEY, b INTEGER NOT NULL);
INSERT IGNORE INTO t1 (b) VALUES (5);
INSERT IGNORE INTO t1 (b) VALUES (5);
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
CREATE TABLE IF NOT EXISTS t2 (a INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY)
...
...
mysql-test/t/create.test
View file @
f140575e
...
@@ -1171,6 +1171,11 @@ CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
...
@@ -1171,6 +1171,11 @@ CREATE TABLE t1(c1 VARCHAR(33), KEY USING HASH (c1) USING BTREE) ENGINE=MEMORY;
SHOW
INDEX
FROM
t1
;
SHOW
INDEX
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug#35924 DEFINER should be stored 'quoted' in I_S
#
--
error
ER_UNKNOWN_ERROR
create
user
mysqltest_1
@
'test@test'
;
#
#
# Bug#38821: Assert table->auto_increment_field_not_null failed in open_table()
# Bug#38821: Assert table->auto_increment_field_not_null failed in open_table()
...
...
sql/mysql_priv.h
View file @
f140575e
...
@@ -614,6 +614,7 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
...
@@ -614,6 +614,7 @@ LEX_USER *create_definer(THD *thd, LEX_STRING *user_name, LEX_STRING *host_name)
LEX_USER
*
get_current_user
(
THD
*
thd
,
LEX_USER
*
user
);
LEX_USER
*
get_current_user
(
THD
*
thd
,
LEX_USER
*
user
);
bool
check_string_length
(
LEX_STRING
*
str
,
bool
check_string_length
(
LEX_STRING
*
str
,
const
char
*
err_msg
,
uint
max_length
);
const
char
*
err_msg
,
uint
max_length
);
bool
check_host_name
(
LEX_STRING
*
str
);
enum
enum_mysql_completiontype
{
enum
enum_mysql_completiontype
{
ROLLBACK_RELEASE
=-
2
,
ROLLBACK
=
1
,
ROLLBACK_AND_CHAIN
=
7
,
ROLLBACK_RELEASE
=-
2
,
ROLLBACK
=
1
,
ROLLBACK_AND_CHAIN
=
7
,
...
...
sql/sql_parse.cc
View file @
f140575e
...
@@ -7982,3 +7982,35 @@ int test_if_data_home_dir(const char *dir)
...
@@ -7982,3 +7982,35 @@ int test_if_data_home_dir(const char *dir)
C_MODE_END
C_MODE_END
/**
Check that host name string is valid.
@param[in] str string to be checked
@return Operation status
@retval FALSE host name is ok
@retval TRUE host name string is longer than max_length or
has invalid symbols
*/
bool
check_host_name
(
LEX_STRING
*
str
)
{
const
char
*
name
=
str
->
str
;
const
char
*
end
=
str
->
str
+
str
->
length
;
if
(
check_string_length
(
str
,
ER
(
ER_HOSTNAME
),
HOSTNAME_LENGTH
))
return
TRUE
;
while
(
name
!=
end
)
{
if
(
*
name
==
'@'
)
{
my_printf_error
(
ER_UNKNOWN_ERROR
,
"Malformed hostname (illegal symbol: '%c')"
,
MYF
(
0
),
*
name
);
return
TRUE
;
}
name
++
;
}
return
FALSE
;
}
sql/sql_yacc.yy
View file @
f140575e
...
@@ -9269,8 +9269,7 @@ user:
...
@@ -9269,8 +9269,7 @@ user:
if (check_string_length(&$$->user,
if (check_string_length(&$$->user,
ER(ER_USERNAME), USERNAME_LENGTH) ||
ER(ER_USERNAME), USERNAME_LENGTH) ||
check_string_length(&$$->host,
check_host_name(&$$->host))
ER(ER_HOSTNAME), HOSTNAME_LENGTH))
MYSQL_YYABORT;
MYSQL_YYABORT;
}
}
| CURRENT_USER optional_braces
| CURRENT_USER optional_braces
...
...
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