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
39f4e575
Commit
39f4e575
authored
May 07, 2005
by
brian@brian-akers-computer.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch for --insert-ignore
parent
6a476984
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
8 deletions
+111
-8
client/client_priv.h
client/client_priv.h
+1
-1
client/mysqldump.c
client/mysqldump.c
+12
-7
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+88
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+10
-0
No files found.
client/client_priv.h
View file @
39f4e575
...
@@ -49,5 +49,5 @@ enum options_client
...
@@ -49,5 +49,5 @@ enum options_client
#ifdef HAVE_NDBCLUSTER_DB
#ifdef HAVE_NDBCLUSTER_DB
,
OPT_NDBCLUSTER
,
OPT_NDB_CONNECTSTRING
,
OPT_NDBCLUSTER
,
OPT_NDB_CONNECTSTRING
#endif
#endif
,
OPT_IGNORE_TABLE
,
OPT_IGNORE_TABLE
,
OPT_INSERT_IGNORE
};
};
client/mysqldump.c
View file @
39f4e575
...
@@ -83,7 +83,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1,
...
@@ -83,7 +83,7 @@ static my_bool verbose=0,tFlag=0,cFlag=0,dFlag=0,quick= 1, extended_insert= 1,
opt_autocommit
=
0
,
opt_disable_keys
=
1
,
opt_xml
=
0
,
opt_autocommit
=
0
,
opt_disable_keys
=
1
,
opt_xml
=
0
,
opt_delete_master_logs
=
0
,
tty_password
=
0
,
opt_delete_master_logs
=
0
,
tty_password
=
0
,
opt_single_transaction
=
0
,
opt_comments
=
0
,
opt_compact
=
0
,
opt_single_transaction
=
0
,
opt_comments
=
0
,
opt_compact
=
0
,
opt_hex_blob
=
0
,
opt_order_by_primary
=
0
;
opt_hex_blob
=
0
,
opt_order_by_primary
=
0
,
opt_ignore
=
0
;
static
ulong
opt_max_allowed_packet
,
opt_net_buffer_length
;
static
ulong
opt_max_allowed_packet
,
opt_net_buffer_length
;
static
MYSQL
mysql_connection
,
*
sock
=
0
;
static
MYSQL
mysql_connection
,
*
sock
=
0
;
static
char
insert_pat
[
12
*
1024
],
*
opt_password
=
0
,
*
current_user
=
0
,
static
char
insert_pat
[
12
*
1024
],
*
opt_password
=
0
,
*
current_user
=
0
,
...
@@ -255,6 +255,9 @@ static struct my_option my_long_options[] =
...
@@ -255,6 +255,9 @@ static struct my_option my_long_options[] =
"use the directive multiple times, once for each table. Each table must "
"use the directive multiple times, once for each table. Each table must "
"be specified with both database and table names, e.g. --ignore-table=database.table"
,
"be specified with both database and table names, e.g. --ignore-table=database.table"
,
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
0
,
0
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"insert-ignore"
,
OPT_INSERT_IGNORE
,
"Insert rows with INSERT IGNORE."
,
(
gptr
*
)
&
opt_ignore
,
(
gptr
*
)
&
opt_ignore
,
0
,
GET_BOOL
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
"lines-terminated-by"
,
OPT_LTB
,
"Lines in the i.file are terminated by ..."
,
{
"lines-terminated-by"
,
OPT_LTB
,
"Lines in the i.file are terminated by ..."
,
(
gptr
*
)
&
lines_terminated
,
(
gptr
*
)
&
lines_terminated
,
0
,
GET_STR
,
(
gptr
*
)
&
lines_terminated
,
(
gptr
*
)
&
lines_terminated
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
...
@@ -1096,13 +1099,15 @@ static uint getTableStructure(char *table, char* db)
...
@@ -1096,13 +1099,15 @@ static uint getTableStructure(char *table, char* db)
my_bool
init
=
0
;
my_bool
init
=
0
;
uint
numFields
;
uint
numFields
;
char
*
strpos
,
*
result_table
,
*
opt_quoted_table
;
char
*
strpos
,
*
result_table
,
*
opt_quoted_table
;
const
char
*
delayed
;
const
char
*
insert_option
;
char
name_buff
[
NAME_LEN
+
3
],
table_buff
[
NAME_LEN
*
2
+
3
];
char
name_buff
[
NAME_LEN
+
3
],
table_buff
[
NAME_LEN
*
2
+
3
];
char
table_buff2
[
NAME_LEN
*
2
+
3
];
char
table_buff2
[
NAME_LEN
*
2
+
3
];
FILE
*
sql_file
=
md_result_file
;
FILE
*
sql_file
=
md_result_file
;
DBUG_ENTER
(
"getTableStructure"
);
DBUG_ENTER
(
"getTableStructure"
);
delayed
=
opt_delayed
?
" DELAYED "
:
""
;
insert_option
=
(
opt_delayed
&&
opt_ignore
)
?
" DELAYED IGNORE "
:
opt_delayed
?
" DELAYED "
:
opt_ignore
?
" IGNORE "
:
""
;
if
(
verbose
)
if
(
verbose
)
fprintf
(
stderr
,
"-- Retrieving table structure for table %s...
\n
"
,
table
);
fprintf
(
stderr
,
"-- Retrieving table structure for table %s...
\n
"
,
table
);
...
@@ -1177,11 +1182,11 @@ static uint getTableStructure(char *table, char* db)
...
@@ -1177,11 +1182,11 @@ static uint getTableStructure(char *table, char* db)
if
(
cFlag
)
if
(
cFlag
)
my_snprintf
(
insert_pat
,
sizeof
(
insert_pat
),
"INSERT %sINTO %s ("
,
my_snprintf
(
insert_pat
,
sizeof
(
insert_pat
),
"INSERT %sINTO %s ("
,
delayed
,
opt_quoted_table
);
insert_option
,
opt_quoted_table
);
else
else
{
{
my_snprintf
(
insert_pat
,
sizeof
(
insert_pat
),
"INSERT %sINTO %s VALUES "
,
my_snprintf
(
insert_pat
,
sizeof
(
insert_pat
),
"INSERT %sINTO %s VALUES "
,
delayed
,
opt_quoted_table
);
insert_option
,
opt_quoted_table
);
if
(
!
extended_insert
)
if
(
!
extended_insert
)
strcat
(
insert_pat
,
"("
);
strcat
(
insert_pat
,
"("
);
}
}
...
@@ -1245,11 +1250,11 @@ static uint getTableStructure(char *table, char* db)
...
@@ -1245,11 +1250,11 @@ static uint getTableStructure(char *table, char* db)
}
}
if
(
cFlag
)
if
(
cFlag
)
my_snprintf
(
insert_pat
,
sizeof
(
insert_pat
),
"INSERT %sINTO %s ("
,
my_snprintf
(
insert_pat
,
sizeof
(
insert_pat
),
"INSERT %sINTO %s ("
,
delayed
,
result_table
);
insert_option
,
result_table
);
else
else
{
{
my_snprintf
(
insert_pat
,
sizeof
(
insert_pat
),
"INSERT %sINTO %s VALUES "
,
my_snprintf
(
insert_pat
,
sizeof
(
insert_pat
),
"INSERT %sINTO %s VALUES "
,
delayed
,
result_table
);
insert_option
,
result_table
);
if
(
!
extended_insert
)
if
(
!
extended_insert
)
strcat
(
insert_pat
,
"("
);
strcat
(
insert_pat
,
"("
);
}
}
...
...
mysql-test/r/mysqldump.result
View file @
39f4e575
...
@@ -560,3 +560,91 @@ UNLOCK TABLES;
...
@@ -560,3 +560,91 @@ 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 decimal(240, 20));
INSERT INTO t1 VALUES ("1234567890123456789012345678901234567890"),
("0987654321098765432109876543210987654321");
-- MySQL dump 10.9
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 4.1.12-debug-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES 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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `t1`
--
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` decimal(240,20) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `t1`
--
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
LOCK TABLES `t1` WRITE;
INSERT IGNORE INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('0987654321098765432109876543210987654321.00000000000000000000');
UNLOCK TABLES;
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- MySQL dump 10.9
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 4.1.12-debug-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES 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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `t1`
--
DROP TABLE IF EXISTS `t1`;
CREATE TABLE `t1` (
`a` decimal(240,20) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `t1`
--
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
INSERT DELAYED IGNORE INTO `t1` VALUES ('1234567890123456789012345678901234567890.00000000000000000000'),('0987654321098765432109876543210987654321.00000000000000000000');
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
DROP TABLE t1;
mysql-test/t/mysqldump.test
View file @
39f4e575
...
@@ -185,3 +185,13 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A);
...
@@ -185,3 +185,13 @@ INSERT INTO `t1` VALUES (0x602010000280100005E71A);
--
exec
$MYSQL_DUMP
--
skip
-
extended
-
insert
--
hex
-
blob
test
--
skip
-
comments
t1
--
exec
$MYSQL_DUMP
--
skip
-
extended
-
insert
--
hex
-
blob
test
--
skip
-
comments
t1
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# Test for --insert-ignore
#
CREATE
TABLE
t1
(
a
decimal
(
240
,
20
));
INSERT
INTO
t1
VALUES
(
"1234567890123456789012345678901234567890"
),
(
"0987654321098765432109876543210987654321"
);
--
exec
$MYSQL_DUMP
--
insert
-
ignore
test
t1
--
exec
$MYSQL_DUMP
--
insert
-
ignore
--
delayed
-
insert
test
t1
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