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
d22ed96a
Commit
d22ed96a
authored
Jul 14, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
bef74a23
62a4848d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
233 additions
and
20 deletions
+233
-20
client/Makefile.am
client/Makefile.am
+1
-1
client/mysqlbinlog.cc
client/mysqlbinlog.cc
+4
-3
client/mysqldump.c
client/mysqldump.c
+13
-5
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+208
-3
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+7
-8
No files found.
client/Makefile.am
View file @
d22ed96a
...
@@ -71,7 +71,7 @@ mysqldump_SOURCES= mysqldump.c \
...
@@ -71,7 +71,7 @@ mysqldump_SOURCES= mysqldump.c \
$(top_srcdir)
/mysys/mf_getdate.c
$(top_srcdir)
/mysys/mf_getdate.c
mysqlimport_SOURCES
=
mysqlimport.c
mysqlimport_SOURCES
=
mysqlimport.c
mysqlimport_CFLAGS
=
-DTHREAD
-UUNDEF_THREADS_HACK
mysqlimport_LDADD
=
$(CXXLDFLAGS)
$(CLIENT_THREAD_LIBS)
\
mysqlimport_LDADD
=
$(CXXLDFLAGS)
$(CLIENT_THREAD_LIBS)
\
@CLIENT_EXTRA_LDFLAGS@
\
@CLIENT_EXTRA_LDFLAGS@
\
$(LIBMYSQLCLIENT_LA)
\
$(LIBMYSQLCLIENT_LA)
\
...
...
client/mysqlbinlog.cc
View file @
d22ed96a
...
@@ -17,10 +17,8 @@
...
@@ -17,10 +17,8 @@
TODO: print the catalog (some USE catalog.db ????).
TODO: print the catalog (some USE catalog.db ????).
Standalone program to read a MySQL binary log (or relay log);
Standalone program to read a MySQL binary log (or relay log).
can read files produced by 3.23, 4.x, 5.0 servers.
Can read binlogs from 3.23/4.x/5.0 and relay logs from 4.x/5.0.
Should be able to read any file of these categories, even with
Should be able to read any file of these categories, even with
--start-position.
--start-position.
An important fact: the Format_desc event of the log is at most the 3rd event
An important fact: the Format_desc event of the log is at most the 3rd event
...
@@ -988,10 +986,13 @@ static struct my_option my_long_options[] =
...
@@ -988,10 +986,13 @@ static struct my_option my_long_options[] =
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
#endif
#endif
{
"base64-output"
,
OPT_BASE64_OUTPUT_MODE
,
{
"base64-output"
,
OPT_BASE64_OUTPUT_MODE
,
/* 'unspec' is not mentioned because it is just a placeholder. */
"Determine when the output statements should be base64-encoded BINLOG "
"Determine when the output statements should be base64-encoded BINLOG "
"statements: 'never' disables it and works only for binlogs without "
"statements: 'never' disables it and works only for binlogs without "
"row-based events; 'auto' is the default and prints base64 only when "
"row-based events; 'auto' is the default and prints base64 only when "
"necessary (i.e., for row-based events and format description events); "
"necessary (i.e., for row-based events and format description events); "
"'decode-rows' suppresses BINLOG statements for row events, but does "
"not exit as an error if a row event is found, unlike 'never'; "
"'always' prints base64 whenever possible. 'always' is for debugging "
"'always' prints base64 whenever possible. 'always' is for debugging "
"only and should not be used in a production system. The default is "
"only and should not be used in a production system. The default is "
"'auto'. --base64-output is a short form for --base64-output=always."
"'auto'. --base64-output is a short form for --base64-output=always."
...
...
client/mysqldump.c
View file @
d22ed96a
...
@@ -3821,6 +3821,10 @@ static int dump_all_databases()
...
@@ -3821,6 +3821,10 @@ static int dump_all_databases()
return
1
;
return
1
;
while
((
row
=
mysql_fetch_row
(
tableres
)))
while
((
row
=
mysql_fetch_row
(
tableres
)))
{
{
if
(
mysql_get_server_version
(
mysql
)
>=
50003
&&
!
my_strcasecmp
(
&
my_charset_latin1
,
row
[
0
],
"information_schema"
))
continue
;
if
(
dump_all_tables_in_db
(
row
[
0
]))
if
(
dump_all_tables_in_db
(
row
[
0
]))
result
=
1
;
result
=
1
;
}
}
...
@@ -3835,6 +3839,10 @@ static int dump_all_databases()
...
@@ -3835,6 +3839,10 @@ static int dump_all_databases()
}
}
while
((
row
=
mysql_fetch_row
(
tableres
)))
while
((
row
=
mysql_fetch_row
(
tableres
)))
{
{
if
(
mysql_get_server_version
(
mysql
)
>=
50003
&&
!
my_strcasecmp
(
&
my_charset_latin1
,
row
[
0
],
"information_schema"
))
continue
;
if
(
dump_all_views_in_db
(
row
[
0
]))
if
(
dump_all_views_in_db
(
row
[
0
]))
result
=
1
;
result
=
1
;
}
}
...
@@ -3941,10 +3949,6 @@ int init_dumping_tables(char *qdatabase)
...
@@ -3941,10 +3949,6 @@ int init_dumping_tables(char *qdatabase)
static
int
init_dumping
(
char
*
database
,
int
init_func
(
char
*
))
static
int
init_dumping
(
char
*
database
,
int
init_func
(
char
*
))
{
{
if
(
mysql_get_server_version
(
mysql
)
>=
50003
&&
!
my_strcasecmp
(
&
my_charset_latin1
,
database
,
"information_schema"
))
return
1
;
if
(
mysql_select_db
(
mysql
,
database
))
if
(
mysql_select_db
(
mysql
,
database
))
{
{
DB_error
(
mysql
,
"when selecting the database"
);
DB_error
(
mysql
,
"when selecting the database"
);
...
@@ -4003,6 +4007,7 @@ static int dump_all_tables_in_db(char *database)
...
@@ -4003,6 +4007,7 @@ static int dump_all_tables_in_db(char *database)
DBUG_RETURN
(
1
);
DBUG_RETURN
(
1
);
if
(
opt_xml
)
if
(
opt_xml
)
print_xml_tag
(
md_result_file
,
""
,
"
\n
"
,
"database"
,
"name="
,
database
,
NullS
);
print_xml_tag
(
md_result_file
,
""
,
"
\n
"
,
"database"
,
"name="
,
database
,
NullS
);
if
(
lock_tables
)
if
(
lock_tables
)
{
{
DYNAMIC_STRING
query
;
DYNAMIC_STRING
query
;
...
@@ -4236,7 +4241,10 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
...
@@ -4236,7 +4241,10 @@ static int dump_selected_tables(char *db, char **table_names, int tables)
}
}
end
=
pos
;
end
=
pos
;
if
(
lock_tables
)
/* Can't LOCK TABLES in INFORMATION_SCHEMA, so don't try. */
if
(
lock_tables
&&
!
(
mysql_get_server_version
(
mysql
)
>=
50003
&&
!
my_strcasecmp
(
&
my_charset_latin1
,
db
,
"information_schema"
)))
{
{
if
(
mysql_real_query
(
mysql
,
lock_tables_query
.
str
,
if
(
mysql_real_query
(
mysql
,
lock_tables_query
.
str
,
lock_tables_query
.
length
-
1
))
lock_tables_query
.
length
-
1
))
...
...
mysql-test/r/mysqldump.result
View file @
d22ed96a
...
@@ -3563,9 +3563,6 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
...
@@ -3563,9 +3563,6 @@ grant REPLICATION CLIENT on *.* to mysqltest_1@localhost;
drop table t1;
drop table t1;
drop user mysqltest_1@localhost;
drop user mysqltest_1@localhost;
#
#
# Bug#21527 mysqldump incorrectly tries to LOCK TABLES on the
# information_schema database.
#
# Bug#21424 mysqldump failing to export/import views
# Bug#21424 mysqldump failing to export/import views
#
#
create database mysqldump_myDB;
create database mysqldump_myDB;
...
@@ -3605,6 +3602,39 @@ drop user myDB_User@localhost;
...
@@ -3605,6 +3602,39 @@ drop user myDB_User@localhost;
drop database mysqldump_myDB;
drop database mysqldump_myDB;
use test;
use test;
#
#
# Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
# information_schema database.
#
# Bug #33762: mysqldump can not dump INFORMATION_SCHEMA
#
DROP TABLE IF EXISTS `TABLES`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TEMPORARY TABLE `TABLES` (
`TABLE_CATALOG` varchar(512) DEFAULT NULL,
`TABLE_SCHEMA` varchar(64) NOT NULL DEFAULT '',
`TABLE_NAME` varchar(64) NOT NULL DEFAULT '',
`TABLE_TYPE` varchar(64) NOT NULL DEFAULT '',
`ENGINE` varchar(64) DEFAULT NULL,
`VERSION` bigint(21) unsigned DEFAULT NULL,
`ROW_FORMAT` varchar(10) DEFAULT NULL,
`TABLE_ROWS` bigint(21) unsigned DEFAULT NULL,
`AVG_ROW_LENGTH` bigint(21) unsigned DEFAULT NULL,
`DATA_LENGTH` bigint(21) unsigned DEFAULT NULL,
`MAX_DATA_LENGTH` bigint(21) unsigned DEFAULT NULL,
`INDEX_LENGTH` bigint(21) unsigned DEFAULT NULL,
`DATA_FREE` bigint(21) unsigned DEFAULT NULL,
`AUTO_INCREMENT` bigint(21) unsigned DEFAULT NULL,
`CREATE_TIME` datetime DEFAULT NULL,
`UPDATE_TIME` datetime DEFAULT NULL,
`CHECK_TIME` datetime DEFAULT NULL,
`TABLE_COLLATION` varchar(32) DEFAULT NULL,
`CHECKSUM` bigint(21) unsigned DEFAULT NULL,
`CREATE_OPTIONS` varchar(255) DEFAULT NULL,
`TABLE_COMMENT` varchar(80) NOT NULL DEFAULT ''
) ENGINE=MEMORY DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
#
# Bug#19745 mysqldump --xml produces invalid xml
# Bug#19745 mysqldump --xml produces invalid xml
#
#
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t1;
...
@@ -4006,6 +4036,181 @@ UNLOCK TABLES;
...
@@ -4006,6 +4036,181 @@ UNLOCK TABLES;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1;
DROP TABLE t1;
create table t1 (a text , b text);
create table t2 (a text , b text);
insert t1 values ("Duck, Duck", "goose");
insert t1 values ("Duck, Duck", "pidgeon");
insert t2 values ("We the people", "in order to perform");
insert t2 values ("a more perfect", "union");
select * from t1;
a b
Duck, Duck goose
Duck, Duck pidgeon
select * from t2;
a b
We the people in order to perform
a more perfect union
test.t1: Records: 2 Deleted: 0 Skipped: 0 Warnings: 0
test.t2: Records: 2 Deleted: 0 Skipped: 0 Warnings: 0
select * from t1;
a b
Duck, Duck goose
Duck, Duck pidgeon
Duck, Duck goose
Duck, Duck pidgeon
select * from t2;
a b
We the people in order to perform
a more perfect union
We the people in order to perform
a more perfect union
create table words(a varchar(255));
create table words2(b varchar(255));
select * from t1;
a b
Duck, Duck goose
Duck, Duck pidgeon
Duck, Duck goose
Duck, Duck pidgeon
Duck, Duck goose
Duck, Duck pidgeon
select * from t2;
a b
We the people in order to perform
a more perfect union
We the people in order to perform
a more perfect union
We the people in order to perform
a more perfect union
select * from words;
a
Aarhus
Aaron
Ababa
aback
abaft
abandon
abandoned
abandoning
abandonment
abandons
Aarhus
Aaron
Ababa
aback
abaft
abandon
abandoned
abandoning
abandonment
abandons
abase
abased
abasement
abasements
abases
abash
abashed
abashes
abashing
abasing
abate
abated
abatement
abatements
abater
abates
abating
Abba
abbe
abbey
abbeys
abbot
abbots
Abbott
abbreviate
abbreviated
abbreviates
abbreviating
abbreviation
abbreviations
Abby
abdomen
abdomens
abdominal
abduct
abducted
abduction
abductions
abductor
abductors
abducts
Abe
abed
Abel
Abelian
Abelson
Aberdeen
Abernathy
aberrant
aberration
select * from words2;
b
abase
abased
abasement
abasements
abases
abash
abashed
abashes
abashing
abasing
abate
abated
abatement
abatements
abater
abates
abating
Abba
abbe
abbey
abbeys
abbot
abbots
Abbott
abbreviate
abbreviated
abbreviates
abbreviating
abbreviation
abbreviations
Abby
abdomen
abdomens
abdominal
abduct
abducted
abduction
abductions
abductor
abductors
abducts
Abe
abed
Abel
Abelian
Abelson
Aberdeen
Abernathy
aberrant
aberration
drop table words;
mysql-import: Error: 1146, Table 'test.words' doesn't exist, when using table: words
drop table t1;
drop table t2;
drop table words2;
#
#
# Bug#16853 mysqldump doesn't show events
# Bug#16853 mysqldump doesn't show events
#
#
...
...
mysql-test/t/mysqldump.test
View file @
d22ed96a
...
@@ -1394,9 +1394,6 @@ drop table t1;
...
@@ -1394,9 +1394,6 @@ drop table t1;
drop
user
mysqltest_1
@
localhost
;
drop
user
mysqltest_1
@
localhost
;
--
echo
#
--
echo
# Bug#21527 mysqldump incorrectly tries to LOCK TABLES on the
--
echo
# information_schema database.
--
echo
#
--
echo
#
--
echo
# Bug#21424 mysqldump failing to export/import views
--
echo
# Bug#21424 mysqldump failing to export/import views
--
echo
#
--
echo
#
...
@@ -1463,6 +1460,13 @@ disconnect root;
...
@@ -1463,6 +1460,13 @@ disconnect root;
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
bug21527
.
sql
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
bug21527
.
sql
use
test
;
use
test
;
--
echo
#
--
echo
# Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
--
echo
# information_schema database.
--
echo
#
--
echo
# Bug #33762: mysqldump can not dump INFORMATION_SCHEMA
--
echo
#
--
exec
$MYSQL_DUMP
--
compact
--
opt
-
d
information_schema
TABLES
--
echo
#
--
echo
#
--
echo
# Bug#19745 mysqldump --xml produces invalid xml
--
echo
# Bug#19745 mysqldump --xml produces invalid xml
...
@@ -1698,9 +1702,6 @@ DROP TABLE t1;
...
@@ -1698,9 +1702,6 @@ DROP TABLE t1;
# Added for use-thread option
# Added for use-thread option
#
#
# THIS PART OF THE TEST IS DISABLED UNTIL Bug#32991 IS FIXED
if
(
$bug32991_fixed
)
{
create
table
t1
(
a
text
,
b
text
);
create
table
t1
(
a
text
,
b
text
);
create
table
t2
(
a
text
,
b
text
);
create
table
t2
(
a
text
,
b
text
);
insert
t1
values
(
"Duck, Duck"
,
"goose"
);
insert
t1
values
(
"Duck, Duck"
,
"goose"
);
...
@@ -1738,8 +1739,6 @@ drop table t2;
...
@@ -1738,8 +1739,6 @@ drop table t2;
drop
table
words2
;
drop
table
words2
;
}
--
echo
#
--
echo
#
--
echo
# Bug#16853 mysqldump doesn't show events
--
echo
# Bug#16853 mysqldump doesn't show events
--
echo
#
--
echo
#
...
...
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