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
21066bde
Commit
21066bde
authored
Nov 06, 2002
by
peter@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/pz/mysql/mysql-4.1-root
into mysql.com:/home/pz/mysql/mysql-4.1
parents
8bcace70
8229d282
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
11 deletions
+25
-11
client/mysqldump.c
client/mysqldump.c
+1
-1
sql/mysql_priv.h
sql/mysql_priv.h
+1
-1
sql/sql_db.cc
sql/sql_db.cc
+12
-5
sql/sql_parse.cc
sql/sql_parse.cc
+1
-1
sql/sql_yacc.yy
sql/sql_yacc.yy
+10
-3
No files found.
client/mysqldump.c
View file @
21066bde
...
@@ -1252,7 +1252,7 @@ static int init_dumping(char *database)
...
@@ -1252,7 +1252,7 @@ static int init_dumping(char *database)
MYSQL_ROW
row
;
MYSQL_ROW
row
;
MYSQL_RES
*
dbinfo
;
MYSQL_RES
*
dbinfo
;
sprintf
(
qbuf
,
"SHOW CREATE DATABASE %s"
,
database
);
sprintf
(
qbuf
,
"SHOW CREATE DATABASE
IF NOT EXISTS
%s"
,
database
);
if
(
mysql_query
(
sock
,
qbuf
)
||
!
(
dbinfo
=
mysql_store_result
(
sock
)))
if
(
mysql_query
(
sock
,
qbuf
)
||
!
(
dbinfo
=
mysql_store_result
(
sock
)))
{
{
...
...
sql/mysql_priv.h
View file @
21066bde
...
@@ -497,7 +497,7 @@ int mysqld_show_logs(THD *thd);
...
@@ -497,7 +497,7 @@ int mysqld_show_logs(THD *thd);
void
mysqld_list_fields
(
THD
*
thd
,
TABLE_LIST
*
table
,
const
char
*
wild
);
void
mysqld_list_fields
(
THD
*
thd
,
TABLE_LIST
*
table
,
const
char
*
wild
);
int
mysqld_dump_create_info
(
THD
*
thd
,
TABLE
*
table
,
int
fd
=
-
1
);
int
mysqld_dump_create_info
(
THD
*
thd
,
TABLE
*
table
,
int
fd
=
-
1
);
int
mysqld_show_create
(
THD
*
thd
,
TABLE_LIST
*
table_list
);
int
mysqld_show_create
(
THD
*
thd
,
TABLE_LIST
*
table_list
);
int
mysqld_show_create_db
(
THD
*
thd
,
const
char
*
dbname
);
int
mysqld_show_create_db
(
THD
*
thd
,
const
char
*
dbname
,
HA_CREATE_INFO
*
create
);
void
mysqld_list_processes
(
THD
*
thd
,
const
char
*
user
,
bool
verbose
);
void
mysqld_list_processes
(
THD
*
thd
,
const
char
*
user
,
bool
verbose
);
int
mysqld_show_status
(
THD
*
thd
);
int
mysqld_show_status
(
THD
*
thd
);
...
...
sql/sql_db.cc
View file @
21066bde
...
@@ -597,7 +597,7 @@ bool mysql_change_db(THD *thd, const char *name)
...
@@ -597,7 +597,7 @@ bool mysql_change_db(THD *thd, const char *name)
}
}
int
mysqld_show_create_db
(
THD
*
thd
,
const
char
*
dbname
)
int
mysqld_show_create_db
(
THD
*
thd
,
const
char
*
dbname
,
HA_CREATE_INFO
*
create_info
)
{
{
int
length
;
int
length
;
char
path
[
FN_REFLEN
],
*
to
;
char
path
[
FN_REFLEN
],
*
to
;
...
@@ -605,6 +605,8 @@ int mysqld_show_create_db(THD *thd, const char *dbname)
...
@@ -605,6 +605,8 @@ int mysqld_show_create_db(THD *thd, const char *dbname)
bool
found_libchar
;
bool
found_libchar
;
HA_CREATE_INFO
create
;
HA_CREATE_INFO
create
;
CONVERT
*
convert
=
thd
->
variables
.
convert_set
;
CONVERT
*
convert
=
thd
->
variables
.
convert_set
;
uint
create_options
=
create_info
?
create_info
->
options
:
0
;
DBUG_ENTER
(
"mysql_show_create_db"
);
DBUG_ENTER
(
"mysql_show_create_db"
);
if
(
check_db_name
(
dbname
))
if
(
check_db_name
(
dbname
))
...
@@ -660,12 +662,17 @@ int mysqld_show_create_db(THD *thd, const char *dbname)
...
@@ -660,12 +662,17 @@ int mysqld_show_create_db(THD *thd, const char *dbname)
String
*
packet
=
&
thd
->
packet
;
String
*
packet
=
&
thd
->
packet
;
packet
->
length
(
0
);
packet
->
length
(
0
);
net_store_data
(
packet
,
convert
,
dbname
);
net_store_data
(
packet
,
convert
,
dbname
);
to
=
strxmov
(
path
,
"CREATE DATABASE `"
,
dbname
,
"`"
,
NullS
);
to
=
strxmov
(
path
,
"CREATE DATABASE "
,
NullS
);
if
(
create_options
&
HA_LEX_CREATE_IF_NOT_EXISTS
)
to
=
strxmov
(
to
,
"/*!32312 IF NOT EXISTS*/ "
,
NullS
);
to
=
strxmov
(
to
,
"`"
,
dbname
,
"`"
,
NullS
);
if
(
create
.
table_charset
)
if
(
create
.
table_charset
)
to
=
strxmov
(
to
,
" DEFAULT CHARACTER SET "
,
create
.
table_charset
->
name
,
to
=
strxmov
(
to
,
" /*!40100 DEFAULT CHARACTER SET "
,
NullS
);
create
.
table_charset
->
name
,
"*/"
,
NullS
);
net_store_data
(
packet
,
convert
,
path
,
(
uint
)
(
to
-
path
));
net_store_data
(
packet
,
convert
,
path
,
(
uint
)
(
to
-
path
));
if
(
my_net_write
(
&
thd
->
net
,(
char
*
)
packet
->
ptr
(),
packet
->
length
()))
if
(
my_net_write
(
&
thd
->
net
,(
char
*
)
packet
->
ptr
(),
packet
->
length
()))
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
...
...
sql/sql_parse.cc
View file @
21066bde
...
@@ -2465,7 +2465,7 @@ mysql_execute_command(THD *thd)
...
@@ -2465,7 +2465,7 @@ mysql_execute_command(THD *thd)
send_error
(
thd
,
ER_LOCK_OR_ACTIVE_TRANSACTION
);
send_error
(
thd
,
ER_LOCK_OR_ACTIVE_TRANSACTION
);
goto
error
;
goto
error
;
}
}
res
=
mysqld_show_create_db
(
thd
,
lex
->
name
);
res
=
mysqld_show_create_db
(
thd
,
lex
->
name
,
&
lex
->
create_info
);
break
;
break
;
}
}
case
SQLCOM_CREATE_FUNCTION
:
case
SQLCOM_CREATE_FUNCTION
:
...
...
sql/sql_yacc.yy
View file @
21066bde
...
@@ -2987,7 +2987,13 @@ opt_table_sym:
...
@@ -2987,7 +2987,13 @@ opt_table_sym:
/* Show things */
/* Show things */
show: SHOW { Lex->wild=0;} show_param;
show: SHOW
{
LEX *lex=Lex;
lex->wild=0;
bzero((char*) &lex->create_info,sizeof(lex->create_info));
}
show_param;
show_param:
show_param:
DATABASES wild
DATABASES wild
...
@@ -3100,10 +3106,11 @@ show_param:
...
@@ -3100,10 +3106,11 @@ show_param:
lex->grant_user=$3;
lex->grant_user=$3;
lex->grant_user->password.str=NullS;
lex->grant_user->password.str=NullS;
}
}
| CREATE DATABASE ident
| CREATE DATABASE
opt_if_not_exists
ident
{
{
Lex->sql_command=SQLCOM_SHOW_CREATE_DB;
Lex->sql_command=SQLCOM_SHOW_CREATE_DB;
Lex->name=$3.str;
Lex->create_info.options=$3;
Lex->name=$4.str;
}
}
| CREATE TABLE_SYM table_ident
| CREATE TABLE_SYM table_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