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
bdf696d0
Commit
bdf696d0
authored
Feb 14, 2004
by
vva@eagle.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug #2705 "mysqldump --tab extra output"
parent
8e6a2e98
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
12 deletions
+59
-12
client/mysqldump.c
client/mysqldump.c
+19
-6
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+24
-6
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+16
-0
No files found.
client/mysqldump.c
View file @
bdf696d0
...
...
@@ -366,11 +366,16 @@ static void write_header(FILE *sql_file, char *db_name)
}
if
(
!
opt_set_names
)
fprintf
(
sql_file
,
"
\n
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=%s */;
\n
"
,
default_charset
);
fprintf
(
md_result_file
,
"\
if
(
!
path
)
{
fprintf
(
md_result_file
,
"\
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
\n
\
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
\n
\
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=NO_AUTO_VALUE_ON_ZERO */;
\n
\
"
);
}
fprintf
(
sql_file
,
"/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
\"
%s
\"
*/;
\n
"
,
path
?
""
:
"NO_AUTO_VALUE_ON_ZERO"
);
}
return
;
}
/* write_header */
...
...
@@ -382,12 +387,15 @@ static void write_footer(FILE *sql_file)
fputs
(
"</mysqldump>
\n
"
,
sql_file
);
else
if
(
!
opt_compact
)
{
fprintf
(
md_result_file
,
"
\n
\
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
\n
\
fprintf
(
sql_file
,
"
\n
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
\n
"
);
if
(
!
path
)
{
fprintf
(
md_result_file
,
"\
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
\n
\
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
\n
"
);
}
if
(
!
opt_set_names
)
fprintf
(
md_result
_file
,
fprintf
(
sql
_file
,
"/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
\n
"
);
fputs
(
"
\n
"
,
sql_file
);
}
...
...
@@ -1153,7 +1161,11 @@ static uint getTableStructure(char *table, char* db)
strpos
=
strmov
(
strpos
,
"("
);
}
if
(
sql_file
!=
md_result_file
)
{
fputs
(
"
\n
"
,
sql_file
);
write_footer
(
sql_file
);
my_fclose
(
sql_file
,
MYF
(
MY_WME
));
}
DBUG_RETURN
(
numFields
);
}
/* getTableStructure */
...
...
@@ -1940,7 +1952,8 @@ MASTER_LOG_POS=%s ;\n",row[0],row[1]);
}
}
dbDisconnect
(
current_host
);
write_footer
(
md_result_file
);
if
(
!
path
)
write_footer
(
md_result_file
);
if
(
md_result_file
!=
stdout
)
my_fclose
(
md_result_file
,
MYF
(
0
));
my_free
(
opt_password
,
MYF
(
MY_ALLOW_ZERO_PTR
));
...
...
mysql-test/r/mysqldump.result
View file @
bdf696d0
...
...
@@ -25,7 +25,7 @@ INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
NO_AUTO_VALUE_ON_ZERO
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO"
*/;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` decimal(240,20) default NULL
...
...
@@ -50,7 +50,7 @@ INSERT INTO t1 VALUES (-9e999999);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
NO_AUTO_VALUE_ON_ZERO
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO"
*/;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` double default NULL
...
...
@@ -119,7 +119,7 @@ INSERT INTO t1 VALUES (_koi8r x'C1C2C3C4C5');
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
NO_AUTO_VALUE_ON_ZERO
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO"
*/;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` varchar(255) default NULL
...
...
@@ -142,7 +142,7 @@ CREATE TABLE t1 (a int) ENGINE=MYISAM;
INSERT INTO t1 VALUES (1), (2);
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
NO_AUTO_VALUE_ON_ZERO
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO"
*/;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) default NULL
...
...
@@ -161,7 +161,7 @@ UNLOCK TABLES;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
NO_AUTO_VALUE_ON_ZERO
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO"
*/;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) default NULL
...
...
@@ -184,7 +184,7 @@ create table ```a` (i int);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
NO_AUTO_VALUE_ON_ZERO
*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=
"NO_AUTO_VALUE_ON_ZERO"
*/;
DROP TABLE IF EXISTS ```a`;
CREATE TABLE ``a` (
`i` int(11) default NULL
...
...
@@ -202,3 +202,21 @@ UNLOCK TABLES;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
drop table ```a`;
create table t1(a int);
insert into t1 values (1),(2),(3);
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE="" */;
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
1
2
3
drop table t1;
mysql-test/t/mysqldump.test
View file @
bdf696d0
...
...
@@ -71,3 +71,19 @@ DROP TABLE t1;
create
table
```a`
(
i
int
);
--
exec
$MYSQL_DUMP
--
skip
-
comments
test
drop
table
```a`
;
#
# Bug #2705 'mysqldump --tab extra output'
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
1
),(
2
),(
3
);
--
exec
$MYSQL_DUMP
--
skip
-
comments
--
tab
=
$MYSQL_TEST_DIR
/
var
/
tmp
/
test
--
exec
cat
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
.
sql
--
exec
cat
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
.
txt
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
.
sql
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
.
txt
--
exec
$MYSQL_DUMP
--
tab
=
$MYSQL_TEST_DIR
/
var
/
tmp
/
test
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
.
sql
--
exec
rm
$MYSQL_TEST_DIR
/
var
/
tmp
/
t1
.
txt
drop
table
t1
;
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