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
306bd2fc
Commit
306bd2fc
authored
Mar 02, 2005
by
ingo@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
b9ae89a1
d3d7c46b
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
69 additions
and
11 deletions
+69
-11
innobase/include/srv0srv.h
innobase/include/srv0srv.h
+2
-4
innobase/srv/srv0srv.c
innobase/srv/srv0srv.c
+3
-4
myisam/mi_create.c
myisam/mi_create.c
+15
-0
myisam/mi_open.c
myisam/mi_open.c
+1
-1
myisam/myisamdef.h
myisam/myisamdef.h
+1
-0
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+18
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+26
-0
sql/ha_innodb.cc
sql/ha_innodb.cc
+3
-1
sql/ha_innodb.h
sql/ha_innodb.h
+0
-1
No files found.
innobase/include/srv0srv.h
View file @
306bd2fc
...
...
@@ -52,7 +52,7 @@ extern ulint* srv_data_file_is_raw_partition;
extern
ibool
srv_auto_extend_last_data_file
;
extern
ulint
srv_last_file_size_max
;
extern
ul
int
srv_auto_extend_increment
;
extern
ul
ong
srv_auto_extend_increment
;
extern
ibool
srv_created_new_raw
;
...
...
@@ -112,11 +112,9 @@ extern ibool srv_use_checksums;
extern
ibool
srv_set_thread_priorities
;
extern
int
srv_query_thread_priority
;
extern
ul
int
srv_max_purge_lag
;
extern
ul
ong
srv_max_purge_lag
;
extern
ibool
srv_use_awe
;
extern
ibool
srv_use_adaptive_hash_indexes
;
extern
ulint
srv_max_purge_lag
;
/*-------------------------------------------*/
extern
ulint
srv_n_rows_inserted
;
...
...
innobase/srv/srv0srv.c
View file @
306bd2fc
...
...
@@ -97,7 +97,7 @@ ulint srv_last_file_size_max = 0; /* if != 0, this tells
the max size auto-extending
may increase the last data
file size */
ul
int
srv_auto_extend_increment
=
8
;
/* If the last data file is
ul
ong
srv_auto_extend_increment
=
8
;
/* If the last data file is
auto-extended, we add this
many pages to it at a time */
ulint
*
srv_data_file_is_raw_partition
=
NULL
;
...
...
@@ -323,9 +323,6 @@ disable adaptive hash indexes */
ibool
srv_use_awe
=
FALSE
;
ibool
srv_use_adaptive_hash_indexes
=
TRUE
;
/* Maximum allowable purge history length. <=0 means 'infinite'. */
ulint
srv_max_purge_lag
=
0
;
/*-------------------------------------------*/
ulint
srv_n_spin_wait_rounds
=
20
;
ulint
srv_n_free_tickets_to_enter
=
500
;
...
...
@@ -972,6 +969,8 @@ srv_general_init(void)
/*======================= InnoDB Server FIFO queue =======================*/
/* Maximum allowable purge history length. <=0 means 'infinite'. */
ulong
srv_max_purge_lag
=
0
;
/*************************************************************************
Puts an OS thread to wait if there are too many concurrent threads
...
...
myisam/mi_create.c
View file @
306bd2fc
...
...
@@ -558,6 +558,21 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
create_flag
=
MY_DELETE_OLD
;
}
/*
If a MRG_MyISAM table is in use, the mapped MyISAM tables are open,
but no entry is made in the table cache for them.
A TRUNCATE command checks for the table in the cache only and could
be fooled to believe, the table is not open.
Pull the emergency brake in this situation. (Bug #8306)
*/
if
(
test_if_reopen
(
filename
))
{
my_printf_error
(
0
,
"MyISAM table '%s' is in use "
"(most likely by a MERGE table). Try FLUSH TABLES."
,
MYF
(
0
),
name
+
dirname_length
(
name
));
goto
err
;
}
if
((
file
=
my_create_with_symlink
(
linkname_ptr
,
filename
,
0
,
O_RDWR
|
O_TRUNC
,
...
...
myisam/mi_open.c
View file @
306bd2fc
...
...
@@ -50,7 +50,7 @@ if (pos > end_pos) \
** In MySQL the server will handle version issues.
******************************************************************************/
static
MI_INFO
*
test_if_reopen
(
char
*
filename
)
MI_INFO
*
test_if_reopen
(
char
*
filename
)
{
LIST
*
pos
;
...
...
myisam/myisamdef.h
View file @
306bd2fc
...
...
@@ -708,6 +708,7 @@ void mi_copy_status(void* to,void *from);
my_bool
mi_check_status
(
void
*
param
);
void
mi_disable_non_unique_index
(
MI_INFO
*
info
,
ha_rows
rows
);
extern
MI_INFO
*
test_if_reopen
(
char
*
filename
);
my_bool
check_table_is_closed
(
const
char
*
name
,
const
char
*
where
);
int
mi_open_datafile
(
MI_INFO
*
info
,
MYISAM_SHARE
*
share
,
File
file_to_dup
);
int
mi_open_keyfile
(
MYISAM_SHARE
*
share
);
...
...
mysql-test/r/myisam.result
View file @
306bd2fc
...
...
@@ -568,6 +568,24 @@ select count(*) from t1 where a is null;
count(*)
2
drop table t1;
create table t1 (c1 int, index(c1));
create table t2 (c1 int, index(c1)) engine=merge union=(t1);
insert into t1 values (1);
flush tables;
select * from t2;
c1
1
flush tables;
truncate table t1;
insert into t1 values (1);
flush tables;
select * from t2;
c1
1
truncate table t1;
ERROR HY000: MyISAM table 't1' is in use (most likely by a MERGE table). Try FLUSH TABLES.
insert into t1 values (1);
drop table t1,t2;
set storage_engine=MyISAM;
drop table if exists t1,t2,t3;
--- Testing varchar ---
...
...
mysql-test/t/myisam.test
View file @
306bd2fc
...
...
@@ -527,6 +527,32 @@ explain select count(*) from t1 where a is null;
select
count
(
*
)
from
t1
where
a
is
null
;
drop
table
t1
;
#
# Bug #8306: TRUNCATE leads to index corruption
#
create
table
t1
(
c1
int
,
index
(
c1
));
create
table
t2
(
c1
int
,
index
(
c1
))
engine
=
merge
union
=
(
t1
);
insert
into
t1
values
(
1
);
# Close all tables.
flush
tables
;
# Open t2 and (implicitly) t1.
select
*
from
t2
;
# Truncate after flush works (unless another threads reopens t2 in between).
flush
tables
;
truncate
table
t1
;
insert
into
t1
values
(
1
);
# Close all tables.
flush
tables
;
# Open t2 and (implicitly) t1.
select
*
from
t2
;
# Truncate t1, wich was not recognized as open without the bugfix.
# Now, it should fail with a table-in-use error message.
--
error
1105
truncate
table
t1
;
# The insert used to fail on the crashed table.
insert
into
t1
values
(
1
);
drop
table
t1
,
t2
;
#
# Test varchar
#
...
...
sql/ha_innodb.cc
View file @
306bd2fc
...
...
@@ -2631,7 +2631,9 @@ ha_innobase::write_row(
if
(
table
->
timestamp_field_type
&
TIMESTAMP_AUTO_SET_ON_INSERT
)
table
->
timestamp_field
->
set_time
();
if
(
user_thd
->
lex
->
sql_command
==
SQLCOM_ALTER_TABLE
if
((
user_thd
->
lex
->
sql_command
==
SQLCOM_ALTER_TABLE
||
user_thd
->
lex
->
sql_command
==
SQLCOM_CREATE_INDEX
||
user_thd
->
lex
->
sql_command
==
SQLCOM_DROP_INDEX
)
&&
num_write_row
>=
10000
)
{
/* ALTER TABLE is COMMITted at every 10000 copied rows.
The IX table lock for the original table has to be re-issued.
...
...
sql/ha_innodb.h
View file @
306bd2fc
...
...
@@ -239,7 +239,6 @@ extern ulong srv_auto_extend_increment;
extern
ulong
srv_n_spin_wait_rounds
;
extern
ulong
srv_n_free_tickets_to_enter
;
extern
ulong
srv_thread_sleep_delay
;
extern
ulong
srv_max_purge_lag
;
extern
ulong
srv_thread_concurrency
;
}
...
...
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