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
eed92880
Commit
eed92880
authored
Apr 29, 2009
by
Alexey Botchkov
Browse files
Options
Browse Files
Download
Plain Diff
merging
parents
ddc9a195
ae154dca
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
45 deletions
+61
-45
mysql-test/r/insert_update.result
mysql-test/r/insert_update.result
+1
-0
mysql-test/r/sp_trans_log.result
mysql-test/r/sp_trans_log.result
+4
-1
mysql-test/r/varbinary.result
mysql-test/r/varbinary.result
+1
-0
mysql-test/t/insert_update.test
mysql-test/t/insert_update.test
+10
-9
mysql-test/t/sp_trans_log.test
mysql-test/t/sp_trans_log.test
+14
-5
mysql-test/t/varbinary.test
mysql-test/t/varbinary.test
+1
-0
scripts/mysqlhotcopy.sh
scripts/mysqlhotcopy.sh
+30
-30
No files found.
mysql-test/r/insert_update.result
View file @
eed92880
...
...
@@ -393,6 +393,7 @@ id c1 cnt
1 0 3
2 2 1
DROP TABLE t1;
DROP TABLE t2;
create table t1(f1 int primary key,
f2 timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP);
insert into t1(f1) values(1);
...
...
mysql-test/r/sp_trans_log.result
View file @
eed92880
drop function if exists bug23333|
drop table if exists t1,t2|
CREATE TABLE t1 (a int NOT NULL auto_increment primary key) ENGINE=MyISAM|
CREATE TABLE t2 (a int NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
insert into t2 values (1,1)|
...
...
@@ -20,4 +22,5 @@ master-bin.000001 # Query 1 # #
select count(*),@a from t1 /* must be 1,1 */|
count(*) @a
1 1
drop table t1, t2|
drop table t1,t2;
drop function if exists bug23333;
mysql-test/r/varbinary.result
View file @
eed92880
...
...
@@ -78,6 +78,7 @@ alter table t1 modify a varchar(255);
select length(a) from t1;
length(a)
6
drop table t1;
select 0b01000001;
0b01000001
A
...
...
mysql-test/t/insert_update.test
View file @
eed92880
...
...
@@ -12,7 +12,7 @@ INSERT t1 VALUES (8,4,50) ON DUPLICATE KEY UPDATE c=c+1000;
SELECT
*
FROM
t1
;
INSERT
t1
VALUES
(
1
,
4
,
60
)
ON
DUPLICATE
KEY
UPDATE
c
=
c
+
10000
;
SELECT
*
FROM
t1
;
--
error
1062
--
error
ER_DUP_ENTRY
INSERT
t1
VALUES
(
1
,
9
,
70
)
ON
DUPLICATE
KEY
UPDATE
c
=
c
+
100000
,
b
=
4
;
SELECT
*
FROM
t1
;
TRUNCATE
TABLE
t1
;
...
...
@@ -63,7 +63,7 @@ INSERT t1 SELECT 8,4,50 FROM DUAL ON DUPLICATE KEY UPDATE c=c+1000;
SELECT
*
FROM
t1
;
INSERT
t1
SELECT
1
,
4
,
60
FROM
DUAL
ON
DUPLICATE
KEY
UPDATE
c
=
c
+
10000
;
SELECT
*
FROM
t1
;
--
error
1062
--
error
ER_DUP_ENTRY
INSERT
t1
SELECT
1
,
9
,
70
FROM
DUAL
ON
DUPLICATE
KEY
UPDATE
c
=
c
+
100000
,
b
=
4
;
SELECT
*
FROM
t1
;
TRUNCATE
TABLE
t1
;
...
...
@@ -76,7 +76,7 @@ INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100;
SELECT
*
FROM
t1
;
INSERT
t1
SET
a
=
5
ON
DUPLICATE
KEY
UPDATE
b
=
0
;
SELECT
*
FROM
t1
;
--
error
1052
--
error
ER_NON_UNIQ_ERROR
INSERT
t1
SELECT
a
,
b
,
c
FROM
t2
WHERE
d
=
2
ON
DUPLICATE
KEY
UPDATE
c
=
c
+
VALUES
(
a
);
INSERT
t1
SELECT
a
,
b
,
c
FROM
t2
WHERE
d
=
2
ON
DUPLICATE
KEY
UPDATE
c
=
t1
.
c
+
VALUES
(
t1
.
a
);
SELECT
*
,
VALUES
(
a
)
FROM
t1
;
...
...
@@ -95,9 +95,9 @@ insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ;
select
*
from
t1
;
insert
into
t1
select
1
on
duplicate
key
update
a
=
2
;
select
*
from
t1
;
--
error
1052
--
error
ER_NON_UNIQ_ERROR
insert
into
t1
select
a
from
t1
on
duplicate
key
update
a
=
a
+
1
;
--
error
1052
--
error
ER_NON_UNIQ_ERROR
insert
ignore
into
t1
select
a
from
t1
on
duplicate
key
update
a
=
t1
.
a
+
1
;
drop
table
t1
;
...
...
@@ -171,13 +171,13 @@ SET SQL_MODE = 'TRADITIONAL';
CREATE
TABLE
t1
(
a
INT
PRIMARY
KEY
,
b
INT
NOT
NULL
);
--
error
1364
--
error
ER_NO_DEFAULT_FOR_FIELD
INSERT
INTO
t1
(
a
)
VALUES
(
1
);
--
error
1364
--
error
ER_NO_DEFAULT_FOR_FIELD
INSERT
INTO
t1
(
a
)
VALUES
(
1
)
ON
DUPLICATE
KEY
UPDATE
a
=
b
;
--
error
1364
--
error
ER_NO_DEFAULT_FOR_FIELD
INSERT
INTO
t1
(
a
)
VALUES
(
1
)
ON
DUPLICATE
KEY
UPDATE
b
=
b
;
SELECT
*
FROM
t1
;
...
...
@@ -278,7 +278,7 @@ INSERT INTO t1 (id,c1) VALUES (1,10);
SELECT
*
FROM
t1
;
CREATE
TABLE
t2
(
id
INT
,
c1
INT
);
INSERT
INTO
t2
VALUES
(
1
,
NULL
),
(
2
,
2
);
--
error
1048
--
error
ER_BAD_NULL_ERROR
INSERT
INTO
t1
(
id
,
c1
)
SELECT
1
,
NULL
ON
DUPLICATE
KEY
UPDATE
c1
=
NULL
;
SELECT
*
FROM
t1
;
...
...
@@ -290,6 +290,7 @@ INSERT IGNORE INTO t1 (id,c1) SELECT * FROM t2
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t2
;
#
# Bug#28904: INSERT .. ON DUPLICATE was silently updating rows when it
...
...
mysql-test/t/sp_trans_log.test
View file @
eed92880
...
...
@@ -4,11 +4,15 @@
delimiter
|
;
#
# Bug
#13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog
# Bug
#23333 stored function + non-transac table + transac table =
#
breaks stmt-based binlog
# Bug
#27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
# Bug#13270 INSERT,UPDATE,etc that calls func with side-effect does not binlog
# Bug#23333 stored function + non-transac table + transac table =
# breaks stmt-based binlog
# Bug#27395 OPTION_STATUS_NO_TRANS_UPDATE is not preserved at the end of SF()
#
--
disable_warnings
drop
function
if
exists
bug23333
|
drop
table
if
exists
t1
,
t2
|
--
enable_warnings
CREATE
TABLE
t1
(
a
int
NOT
NULL
auto_increment
primary
key
)
ENGINE
=
MyISAM
|
CREATE
TABLE
t2
(
a
int
NOT
NULL
auto_increment
,
b
int
,
PRIMARY
KEY
(
a
))
ENGINE
=
InnoDB
|
...
...
@@ -29,5 +33,10 @@ insert into t2 values (bug23333(),1)|
--
replace_column
2
# 5 # 6 #
show
binlog
events
from
98
/* with fixes for #23333 will show there are 2 queries */
|
select
count
(
*
),
@
a
from
t1
/* must be 1,1 */
|
drop
table
t1
,
t2
|
delimiter
;
|
# clean-up
drop
table
t1
,
t2
;
drop
function
if
exists
bug23333
;
mysql-test/t/varbinary.test
View file @
eed92880
...
...
@@ -83,6 +83,7 @@ insert into t1 values("aaa ");
select
length
(
a
)
from
t1
;
alter
table
t1
modify
a
varchar
(
255
);
select
length
(
a
)
from
t1
;
drop
table
t1
;
#
# Bug#35658 (An empty binary value leads to mysqld crash)
...
...
scripts/mysqlhotcopy.sh
View file @
eed92880
...
...
@@ -49,11 +49,11 @@ $0 Ver $VERSION
Usage:
$0
db_name[./table_regex/] [new_db_name | directory]
-?, --help display this helpscreen and exit
-?, --help display this help
-
screen and exit
-u, --user=# user for database login if not current user
-p, --password=# password to use when connecting to server (if not set
in my.cnf, which is recommended)
-h, --host=#
H
ostname for local server when connecting over TCP/IP
-h, --host=#
h
ostname for local server when connecting over TCP/IP
-P, --port=# port to use when connecting to local server with TCP/IP
-S, --socket=# socket to use when connecting to local server
...
...
@@ -86,7 +86,7 @@ sub usage {
# Do not initialize user or password options; that way, any user/password
# options specified in option files will be used. If no values are specified
# all, the defaults will be used (login name, no password).
# a
t a
ll, the defaults will be used (login name, no password).
my %opt
=
(
noindices
=>
0,
...
...
@@ -95,7 +95,7 @@ my %opt = (
method
=>
"cp"
,
flushlog
=>
0,
)
;
Getopt::Long::Configure
(
qw
(
no_ignore_case
))
;
# disamb
u
guate -p and -P
Getopt::Long::Configure
(
qw
(
no_ignore_case
))
;
# disamb
i
guate -p and -P
GetOptions
(
\%
opt,
"help"
,
"host|h=s"
,
...
...
@@ -453,7 +453,7 @@ else {
printf
"Locked
$num_tables
tables in %d seconds.
\n
"
, time-
$start
unless
$opt
{
quiet
}
;
$hc_started
=
time
;
# count from time lock is granted
# flush tables to make on-disk copy up
to
date
# flush tables to make on-disk copy up
to
date
$start
=
time
;
$dbh
->do
(
"FLUSH TABLES /*!32323
$hc_tables
*/"
)
;
printf
"Flushed tables (
$hc_tables
) in %d seconds.
\n
"
, time-
$start
unless
$opt
{
quiet
}
;
...
...
@@ -895,7 +895,7 @@ tables and you don't want to have all the tables locked for the
whole duration.
In this situation, I<
if
>
you are happy
for
groups
of tables to be
backed up separately
(
and thus possibly not be logically consist
a
nt
backed up separately
(
and thus possibly not be logically consist
e
nt
with one another
)
then
you can run mysqlhotcopy several
times
on
the same database each with different db_name./table_regex/.
All but the first should use the
--addtodest
option so the tables
...
...
@@ -920,7 +920,7 @@ server in a mutual replication setup.
=
item
--regexp
pattern
Copy all databases with names matching the pattern
Copy all databases with names matching the pattern
.
=
item
--regexp
/pattern1/./pattern2/
...
...
@@ -933,7 +933,7 @@ names begin with 'bar' from all databases which names end with 'foo':
=
item db_name./pattern/
Copy only tables matching pattern. Shell metacharacters
(
(
,
)
, |,
!
,
etc.
)
have to be escaped
(
e.g.
\)
.
For example, to
select
all tables
etc.
)
have to be escaped
(
e.g.
,
\)
.
For example, to
select
all tables
in
database db1 whose names begin with
'foo'
or
'bar'
:
mysqlhotcopy
--indices
--method
=
cp
db1./^
\(
foo
\|
bar
\)
/
...
...
@@ -947,19 +947,19 @@ that do not begin with foo nor bar:
=
item -?,
--help
Display help
screen and
exit
Display help
-screen and exit.
=
item
-u
,
--user
=
#
user
for
database login
if
not current user
User
for
database login
if
not current user.
=
item
-p
,
--password
=
#
p
assword to use when connecting to the server. Note that you are strongly
P
assword to use when connecting to the server. Note that you are strongly
encouraged
*
not
*
to use this option as every user would be able to see the
password
in
the process list. Instead use the
'[mysqlhotcopy]'
section
in
one of the config files, normally /etc/my.cnf or your personal ~/.my.cnf.
(
See the chapter
'my.cnf Option Files'
in
the manual
)
(
See the chapter
'my.cnf Option Files'
in
the manual
.
)
=
item
-h
,
-h
,
--host
=
#
...
...
@@ -968,12 +968,12 @@ different from 'localhost' will trigger mysqlhotcopy to use TCP/IP connection.
=
item
-P
,
--port
=
#
p
ort to use when connecting to MySQL server with TCP/IP. This is only used
P
ort to use when connecting to MySQL server with TCP/IP. This is only used
when using the
--host
option.
=
item
-S
,
--socket
=
#
UNIX domain socket to use when connecting to
local
server
UNIX domain socket to use when connecting to
local
server
.
=
item
--noindices
...
...
@@ -983,7 +983,7 @@ on the backup.
=
item
--method
=
#
m
ethod
for
copy
(
only
"cp"
currently supported
)
.
Alpha support
for
M
ethod
for
copy
(
only
"cp"
currently supported
)
.
Alpha support
for
"scp"
was added
in
November 2000. Your experience with the scp method
will vary with your ability to understand how scp works.
'man scp'
and
'man ssh'
are your friends.
...
...
@@ -1000,15 +1000,15 @@ scp or rsync the files at your leisure.
=
item
-q
,
--quiet
be silent except
for
errors
Be silent except
for
errors.
=
item
--debug
Debug messages are displayed
Debug messages are displayed
.
=
item
-n
,
--dryrun
Display commands without actually doing them
Display commands without actually doing them
.
=
back
...
...
@@ -1030,18 +1030,18 @@ to be specified on the command line:
mysqlhotcopy db newdb t1 t2 /^foo_/ : t3 /^bar_/ : +
where
":"
delimits the subsets, the /^foo_/ indicates all tables
with names begining with
"foo_"
and the
"+"
indicates all tables
with names begin
n
ing with
"foo_"
and the
"+"
indicates all tables
not copied by the previous subsets.
newdb is either another not existing database or a full path to a directory
where we can create a directory
'db'
'newdb'
is either the name of the new database, or the full path name
of the new database file. The database should not already exist.
Add option to lock each table
in
turn
for
people
who
don
\'
t need
cross-table integrity.
Add option to FLUSH STATUS just before UNLOCK TABLES.
Add support
for
other copy methods
(
e
g
tar
to single file?
)
.
Add support
for
other copy methods
(
e
.g.,
tar
to single file?
)
.
Add support
for
forthcoming MySQL
``
RAID
''
table subdirectory layouts.
...
...
@@ -1049,26 +1049,26 @@ Add support for forthcoming MySQL ``RAID'' table subdirectory layouts.
Tim Bunce
Martin Waite -
added checkpoint, flushlog, regexp and dryrun options
Martin Waite -
Added checkpoint, flushlog, regexp and dryrun options.
Fixed cleanup of targets when hotcopy fails.
Added
--record_log_pos
.
Added
--record_log_pos
.
RAID tables are now copied
(
don
't know if this works over scp).
Ralph Corderoy -
added synonyms for commands
Ralph Corderoy -
Added synonyms for commands.
Scott Wiersdorf -
added table regex and scp support
Scott Wiersdorf -
Added table regex and scp support.
Monty -
working --noindex (copy only first 2048 bytes of index file)
Fixes for --method=scp
Monty -
Working --noindex (copy only first 2048 bytes of index file).
Fixes for --method=scp
.
Ask Bjoern Hansen - Cleanup code to fix a few bugs and enable -w again.
Emil S. Hansen - Added resetslave and resetmaster.
Jeremy D. Zawodny - Removed depr
i
cated DBI calls. Fixed bug which
Jeremy D. Zawodny - Removed depr
e
cated DBI calls. Fixed bug which
resulted in nothing being copied when a regexp was specified but no
database name(s).
Martin Waite - Fix to handle database name that contains space.
Paul DuBois - Remove end '
/
' from directory names
Paul DuBois - Remove end '
/
' from directory names
.
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