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
75e52671
Commit
75e52671
authored
Jun 05, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
maria cannot rollback yet
parent
3dee3847
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
mysql-test/r/maria.result
mysql-test/r/maria.result
+19
-0
mysql-test/t/maria.test
mysql-test/t/maria.test
+16
-0
storage/maria/ha_maria.cc
storage/maria/ha_maria.cc
+11
-1
No files found.
mysql-test/r/maria.result
View file @
75e52671
...
@@ -2,6 +2,25 @@ set global storage_engine=maria;
...
@@ -2,6 +2,25 @@ set global storage_engine=maria;
set session storage_engine=maria;
set session storage_engine=maria;
drop table if exists t1,t2;
drop table if exists t1,t2;
SET SQL_WARNINGS=1;
SET SQL_WARNINGS=1;
RESET MASTER;
set binlog_format=statement;
CREATE TABLE t1 (a int primary key);
insert t1 values (1),(2),(3);
insert t1 values (4),(2),(5);
ERROR 23000: Duplicate entry '2' for key 'PRIMARY'
select * from t1;
a
1
2
3
4
SHOW BINLOG EVENTS FROM 102;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 102 Query 1 200 use `test`; CREATE TABLE t1 (a int primary key)
master-bin.000001 200 Query 1 291 use `test`; insert t1 values (1),(2),(3)
master-bin.000001 291 Query 1 382 use `test`; insert t1 values (4),(2),(5)
drop table t1;
set binlog_format=default;
CREATE TABLE t1 (
CREATE TABLE t1 (
STRING_DATA char(255) default NULL,
STRING_DATA char(255) default NULL,
KEY string_data (STRING_DATA)
KEY string_data (STRING_DATA)
...
...
mysql-test/t/maria.test
View file @
75e52671
...
@@ -15,6 +15,22 @@ drop table if exists t1,t2;
...
@@ -15,6 +15,22 @@ drop table if exists t1,t2;
--
enable_warnings
--
enable_warnings
SET
SQL_WARNINGS
=
1
;
SET
SQL_WARNINGS
=
1
;
#
# UNIQUE key test
#
# as long as maria cannot rollback, binlog should contain both inserts
#
RESET
MASTER
;
set
binlog_format
=
statement
;
CREATE
TABLE
t1
(
a
int
primary
key
);
insert
t1
values
(
1
),(
2
),(
3
);
--
error
1582
insert
t1
values
(
4
),(
2
),(
5
);
select
*
from
t1
;
SHOW
BINLOG
EVENTS
FROM
102
;
drop
table
t1
;
set
binlog_format
=
default
;
#
#
# Test problem with CHECK TABLE;
# Test problem with CHECK TABLE;
#
#
...
...
storage/maria/ha_maria.cc
View file @
75e52671
...
@@ -31,6 +31,11 @@
...
@@ -31,6 +31,11 @@
#include "ma_rt_index.h"
#include "ma_rt_index.h"
#include "ma_blockrec.h"
#include "ma_blockrec.h"
#define MARIA_CANNOT_ROLLBACK HA_NO_TRANSACTIONS
#ifdef MARIA_CANNOT_ROLLBACK
#define trans_register_ha(A, B, C) do {
/* nothing */
} while(0)
#endif
ulong
maria_recover_options
=
HA_RECOVER_NONE
;
ulong
maria_recover_options
=
HA_RECOVER_NONE
;
static
handlerton
*
maria_hton
;
static
handlerton
*
maria_hton
;
...
@@ -466,7 +471,7 @@ ha_maria::ha_maria(handlerton *hton, TABLE_SHARE *table_arg):
...
@@ -466,7 +471,7 @@ ha_maria::ha_maria(handlerton *hton, TABLE_SHARE *table_arg):
handler
(
hton
,
table_arg
),
file
(
0
),
handler
(
hton
,
table_arg
),
file
(
0
),
int_table_flags
(
HA_NULL_IN_KEY
|
HA_CAN_FULLTEXT
|
HA_CAN_SQL_HANDLER
|
int_table_flags
(
HA_NULL_IN_KEY
|
HA_CAN_FULLTEXT
|
HA_CAN_SQL_HANDLER
|
HA_DUPLICATE_POS
|
HA_CAN_INDEX_BLOBS
|
HA_AUTO_PART_KEY
|
HA_DUPLICATE_POS
|
HA_CAN_INDEX_BLOBS
|
HA_AUTO_PART_KEY
|
HA_FILE_BASED
|
HA_CAN_GEOMETRY
|
HA_FILE_BASED
|
HA_CAN_GEOMETRY
|
MARIA_CANNOT_ROLLBACK
|
HA_CAN_INSERT_DELAYED
|
HA_CAN_BIT_FIELD
|
HA_CAN_RTREEKEYS
|
HA_CAN_INSERT_DELAYED
|
HA_CAN_BIT_FIELD
|
HA_CAN_RTREEKEYS
|
HA_HAS_RECORDS
|
HA_STATS_RECORDS_IS_EXACT
),
HA_HAS_RECORDS
|
HA_STATS_RECORDS_IS_EXACT
),
can_enable_indexes
(
1
)
can_enable_indexes
(
1
)
...
@@ -1885,12 +1890,17 @@ int ha_maria::external_lock(THD *thd, int lock_type)
...
@@ -1885,12 +1890,17 @@ int ha_maria::external_lock(THD *thd, int lock_type)
if
(
!
trnman_decrement_locked_tables
(
trn
))
if
(
!
trnman_decrement_locked_tables
(
trn
))
{
{
/* autocommit ? rollback a transaction */
/* autocommit ? rollback a transaction */
#ifdef MARIA_CANNOT_ROLLBACK
trnman_commit_trn
(
trn
);
THD_TRN
=
0
;
#else
if
(
!
(
thd
->
options
&
(
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
)))
if
(
!
(
thd
->
options
&
(
OPTION_NOT_AUTOCOMMIT
|
OPTION_BEGIN
)))
{
{
trnman_rollback_trn
(
trn
);
trnman_rollback_trn
(
trn
);
DBUG_PRINT
(
"info"
,
(
"THD_TRN set to 0x0"
));
DBUG_PRINT
(
"info"
,
(
"THD_TRN set to 0x0"
));
THD_TRN
=
0
;
THD_TRN
=
0
;
}
}
#endif
}
}
}
}
}
}
...
...
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