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
f2299ee7
Commit
f2299ee7
authored
Jan 29, 2003
by
monty@mashka.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge work:/home/bk/mysql into mashka.mysql.fi:/home/my/mysql-3.23
parents
c6beb583
d88eb71f
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
35 additions
and
22 deletions
+35
-22
sql/mysql_priv.h
sql/mysql_priv.h
+1
-1
sql/mysqld.cc
sql/mysqld.cc
+1
-1
sql/sql_db.cc
sql/sql_db.cc
+0
-2
sql/sql_parse.cc
sql/sql_parse.cc
+9
-16
sql/sql_show.cc
sql/sql_show.cc
+2
-0
sql/table.cc
sql/table.cc
+22
-2
No files found.
sql/mysql_priv.h
View file @
f2299ee7
...
...
@@ -654,7 +654,7 @@ int create_frm(char *name,uint reclength,uchar *fileinfo,
HA_CREATE_INFO
*
create_info
,
uint
keys
);
void
update_create_info_from_table
(
HA_CREATE_INFO
*
info
,
TABLE
*
form
);
int
rename_file_ext
(
const
char
*
from
,
const
char
*
to
,
const
char
*
ext
);
bool
check_db_name
(
c
onst
c
har
*
db
);
bool
check_db_name
(
char
*
db
);
bool
check_column_name
(
const
char
*
name
);
bool
check_table_name
(
const
char
*
name
,
uint
length
);
char
*
get_field
(
MEM_ROOT
*
mem
,
TABLE
*
table
,
uint
fieldnr
);
...
...
sql/mysqld.cc
View file @
f2299ee7
...
...
@@ -2031,7 +2031,7 @@ The server will not act as a slave.");
init_master_info
(
&
glob_mi
);
}
printf
(
ER
(
ER_READY
),
my_progname
,
server_version
,
""
);
printf
(
ER
(
ER_READY
),
my_progname
,
server_version
,
mysql_unix_port
,
mysql_port
);
fflush
(
stdout
);
#ifdef __NT__
...
...
sql/sql_db.cc
View file @
f2299ee7
...
...
@@ -337,8 +337,6 @@ bool mysql_change_db(THD *thd,const char *name)
x_free
(
dbname
);
DBUG_RETURN
(
1
);
}
if
(
lower_case_table_names
)
casedn_str
(
dbname
);
DBUG_PRINT
(
"general"
,(
"Use database: %s"
,
dbname
));
if
(
test_all_bits
(
thd
->
master_access
,
DB_ACLS
))
db_access
=
DB_ACLS
;
...
...
sql/sql_parse.cc
View file @
f2299ee7
...
...
@@ -674,16 +674,19 @@ int mysql_table_dump(THD* thd, char* db, char* tbl_name, int fd)
table_list
->
real_name
=
table_list
->
alias
=
tbl_name
;
table_list
->
lock_type
=
TL_READ_NO_INSERT
;
table_list
->
next
=
0
;
remove_escape
(
table_list
->
real_name
);
if
(
!
(
table
=
open_ltable
(
thd
,
table_list
,
TL_READ_NO_INSERT
)))
DBUG_RETURN
(
1
);
if
(
!
db
||
check_db_name
(
db
))
{
net_printf
(
&
thd
->
net
,
ER_WRONG_DB_NAME
,
db
?
db
:
"NULL"
);
goto
err
;
}
if
(
lower_case_table_names
)
casedn_str
(
tbl_name
);
remove_escape
(
tbl_name
);
if
(
!
(
table
=
open_ltable
(
thd
,
table_list
,
TL_READ_NO_INSERT
)))
DBUG_RETURN
(
1
);
if
(
check_access
(
thd
,
SELECT_ACL
,
db
,
&
table_list
->
grant
.
privilege
))
goto
err
;
if
(
grant_option
&&
check_grant
(
thd
,
SELECT_ACL
,
table_list
))
...
...
@@ -859,6 +862,8 @@ bool do_command(THD *thd)
table_list
.
alias
=
table_list
.
real_name
=
thd
->
strdup
(
packet
+
1
);
thd
->
query
=
fields
=
thd
->
strdup
(
strend
(
packet
+
1
)
+
1
);
mysql_log
.
write
(
thd
,
command
,
"%s %s"
,
table_list
.
real_name
,
fields
);
if
(
lower_case_table_names
)
casedn_str
(
table_list
.
real_name
);
remove_escape
(
table_list
.
real_name
);
// This can't have wildcards
if
(
check_access
(
thd
,
SELECT_ACL
,
table_list
.
db
,
&
thd
->
col_access
))
...
...
@@ -888,8 +893,6 @@ bool do_command(THD *thd)
net_printf
(
&
thd
->
net
,
ER_WRONG_DB_NAME
,
db
?
db
:
"NULL"
);
break
;
}
if
(
lower_case_table_names
)
casedn_str
(
db
);
if
(
check_access
(
thd
,
CREATE_ACL
,
db
,
0
,
1
))
break
;
mysql_log
.
write
(
thd
,
command
,
packet
+
1
);
...
...
@@ -906,8 +909,6 @@ bool do_command(THD *thd)
net_printf
(
&
thd
->
net
,
ER_WRONG_DB_NAME
,
db
?
db
:
"NULL"
);
break
;
}
if
(
lower_case_table_names
)
casedn_str
(
db
);
if
(
check_access
(
thd
,
DROP_ACL
,
db
,
0
,
1
)
||
end_active_trans
(
thd
))
break
;
mysql_log
.
write
(
thd
,
command
,
db
);
...
...
@@ -1944,8 +1945,6 @@ mysql_execute_command(void)
net_printf
(
&
thd
->
net
,
ER_WRONG_DB_NAME
,
lex
->
name
);
break
;
}
if
(
lower_case_table_names
)
casedn_str
(
lex
->
name
);
if
(
check_access
(
thd
,
CREATE_ACL
,
lex
->
name
,
0
,
1
))
break
;
mysql_create_db
(
thd
,
lex
->
name
,
lex
->
create_info
.
options
);
...
...
@@ -1958,8 +1957,6 @@ mysql_execute_command(void)
net_printf
(
&
thd
->
net
,
ER_WRONG_DB_NAME
,
lex
->
name
);
break
;
}
if
(
lower_case_table_names
)
casedn_str
(
lex
->
name
);
if
(
check_access
(
thd
,
DROP_ACL
,
lex
->
name
,
0
,
1
)
||
end_active_trans
(
thd
))
break
;
...
...
@@ -2773,11 +2770,7 @@ TABLE_LIST *add_table_to_list(Table_ident *table, LEX_STRING *alias,
if
(
!
(
alias_str
=
sql_strmake
(
alias_str
,
table
->
table
.
length
)))
DBUG_RETURN
(
0
);
if
(
lower_case_table_names
)
{
casedn_str
(
table
->
table
.
str
);
if
(
table
->
db
.
str
)
casedn_str
(
table
->
db
.
str
);
}
if
(
!
(
ptr
=
(
TABLE_LIST
*
)
thd
->
calloc
(
sizeof
(
TABLE_LIST
))))
DBUG_RETURN
(
0
);
/* purecov: inspected */
ptr
->
db
=
table
->
db
.
str
;
...
...
sql/sql_show.cc
View file @
f2299ee7
...
...
@@ -307,6 +307,8 @@ int mysqld_extend_show_tables(THD *thd,const char *db,const char *wild)
net_store_data
(
packet
,
file_name
);
table_list
.
db
=
(
char
*
)
db
;
table_list
.
real_name
=
table_list
.
alias
=
file_name
;
if
(
lower_case_table_names
)
casedn_str
(
file_name
);
if
(
!
(
table
=
open_ltable
(
thd
,
&
table_list
,
TL_READ
)))
{
for
(
uint
i
=
0
;
i
<
field_list
.
elements
;
i
++
)
...
...
sql/table.cc
View file @
f2299ee7
...
...
@@ -1045,9 +1045,29 @@ char *get_field(MEM_ROOT *mem, TABLE *table, uint fieldnr)
return
to
;
}
bool
check_db_name
(
const
char
*
name
)
/*
Check if database name is valid
SYNPOSIS
check_db_name()
name Name of database
NOTES
If lower_case_table_names is set then database is converted to lower case
RETURN
0 ok
1 error
*/
bool
check_db_name
(
char
*
name
)
{
const
char
*
start
=
name
;
char
*
start
=
name
;
if
(
lower_case_table_names
)
casedn_str
(
name
);
while
(
*
name
)
{
#if defined(USE_MB) && defined(USE_MB_IDENT)
...
...
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