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
6fc74e13
Commit
6fc74e13
authored
Apr 07, 2004
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post-review fixes
HA_EXTRA_WRITE_CACHE now part of start_bulk_insert() test cleanups
parent
e8eda812
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
57 additions
and
88 deletions
+57
-88
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+2
-1
mysql-test/r/repair.result
mysql-test/r/repair.result
+8
-0
mysql-test/r/repair_part2.result
mysql-test/r/repair_part2.result
+0
-8
mysql-test/t/lowercase_table2.test
mysql-test/t/lowercase_table2.test
+1
-1
mysql-test/t/lowercase_table3.test
mysql-test/t/lowercase_table3.test
+1
-1
mysql-test/t/lowercase_table_qcache.test
mysql-test/t/lowercase_table_qcache.test
+1
-1
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+0
-1
mysql-test/t/repair.test
mysql-test/t/repair.test
+4
-4
mysql-test/t/repair_part2-master.sh
mysql-test/t/repair_part2-master.sh
+0
-1
mysql-test/t/repair_part2.test
mysql-test/t/repair_part2.test
+0
-7
sql/field.cc
sql/field.cc
+3
-4
sql/field.h
sql/field.h
+3
-2
sql/ha_myisam.cc
sql/ha_myisam.cc
+13
-9
sql/sql_insert.cc
sql/sql_insert.cc
+9
-36
sql/sql_load.cc
sql/sql_load.cc
+1
-5
sql/sql_table.cc
sql/sql_table.cc
+11
-7
No files found.
mysql-test/r/myisam.result
View file @
6fc74e13
...
...
@@ -523,7 +523,8 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t1 1 a 1 a A 1000 NULL NULL YES BTREE
alter table t1 engine=heap;
alter table t1 disable keys;
ERROR HY000: Table storage engine for 't1' doesn't have this option
Warnings:
Note 1031 Table storage engine for 't1' doesn't have this option
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment
t1 1 a 1 a NULL NULL NULL NULL YES HASH
...
...
mysql-test/r/repair
_part1
.result
→
mysql-test/r/repair.result
View file @
6fc74e13
...
...
@@ -28,3 +28,11 @@ repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair error Table 'test.t1' doesn't exist
create table t1 engine=myisam SELECT 1,"table 1";
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair error Can't open file: 't1.MYI' (errno: 130)
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 1
test.t1 repair status OK
drop table t1;
mysql-test/r/repair_part2.result
deleted
100644 → 0
View file @
e8eda812
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair error Can't open file: 't1.MYI' (errno: 130)
repair table t1 use_frm;
Table Op Msg_type Msg_text
test.t1 repair warning Number of rows changed from 0 to 1
test.t1 repair status OK
drop table t1;
mysql-test/t/lowercase_table2.test
View file @
6fc74e13
#
# Test of --lower-case-table-names=2
# (User has case insensitive file system and want
'
s to preserve case of
# (User has case insensitive file system and wants to preserve case of
# table names)
#
--
source
include
/
have_innodb
.
inc
...
...
mysql-test/t/lowercase_table3.test
View file @
6fc74e13
#
# Test of force of lower-case-table-names=0
# (User has case insensitive file system and want
'
s to preserve case of
# (User has case insensitive file system and wants to preserve case of
# table names)
#
...
...
mysql-test/t/lowercase_table_qcache.test
View file @
6fc74e13
mysql-test/t/myisam.test
View file @
6fc74e13
...
...
@@ -498,7 +498,6 @@ show keys from t1;
alter
table
t1
enable
keys
;
show
keys
from
t1
;
alter
table
t1
engine
=
heap
;
--
error
1031
alter
table
t1
disable
keys
;
show
keys
from
t1
;
drop
table
t1
,
t2
;
...
...
mysql-test/t/repair
_part1
.test
→
mysql-test/t/repair.test
View file @
6fc74e13
...
...
@@ -27,8 +27,8 @@ drop table t1;
# non-existent table
repair
table
t1
use_frm
;
#
# Create test table for repair2
# The following must be last in this file
create
table
t1
engine
=
myisam
SELECT
1
,
"table 1"
;
system
echo
1
>
$MYSQL_TEST_DIR
/
var
/
master
-
data
/
test
/
t1
.
MYI
;
repair
table
t1
;
repair
table
t1
use_frm
;
drop
table
t1
;
mysql-test/t/repair_part2-master.sh
deleted
100644 → 0
View file @
e8eda812
echo
"1"
>
$MYSQL_TEST_DIR
/var/master-data/test/t1.MYI
mysql-test/t/repair_part2.test
deleted
100644 → 0
View file @
e8eda812
#
# This test starts with a crashed t1.MYI file left over from repair.test
#
repair
table
t1
;
repair
table
t1
use_frm
;
drop
table
t1
;
sql/field.cc
View file @
6fc74e13
...
...
@@ -3098,8 +3098,7 @@ longlong Field_timestamp::val_int(void)
}
String
*
Field_timestamp
::
val_str
(
String
*
val_buffer
,
String
*
val_ptr
__attribute__
((
unused
)))
String
*
Field_timestamp
::
val_str
(
String
*
val_buffer
,
String
*
val_ptr
)
{
uint32
temp
,
temp2
;
time_t
time_arg
;
...
...
@@ -3119,8 +3118,8 @@ String *Field_timestamp::val_str(String *val_buffer,
if
(
temp
==
0L
)
{
/* Zero time is "000000" */
val_
buffe
r
->
set
(
"0000-00-00 00:00:00"
,
19
,
&
my_charset_bin
);
return
val_
buffe
r
;
val_
pt
r
->
set
(
"0000-00-00 00:00:00"
,
19
,
&
my_charset_bin
);
return
val_
pt
r
;
}
val_buffer
->
set_charset
(
&
my_charset_bin
);
// Safety
time_arg
=
(
time_t
)
temp
;
...
...
sql/field.h
View file @
6fc74e13
...
...
@@ -98,8 +98,9 @@ public:
virtual
void
store_time
(
TIME
*
ltime
,
timestamp_type
t_type
);
virtual
double
val_real
(
void
)
=
0
;
virtual
longlong
val_int
(
void
)
=
0
;
String
*
val_str
(
String
*
str
)
{
return
val_str
(
str
,
str
);
}
/* val_str(buf1, buf2) gets two buffers and should use them as follows:
inline
String
*
val_str
(
String
*
str
)
{
return
val_str
(
str
,
str
);
}
/*
val_str(buf1, buf2) gets two buffers and should use them as follows:
if it needs a temp buffer to convert result to string - use buf1
example Field_tiny::val_str()
if the value exists as a string already - use buf2
...
...
sql/ha_myisam.cc
View file @
6fc74e13
...
...
@@ -810,7 +810,8 @@ int ha_myisam::preload_keys(THD* thd, HA_CHECK_OPT *check_opt)
}
}
/* disable indexes, making it persistent if requested
/*
disable indexes, making it persistent if requested
SYNOPSIS
disable_indexes(all, save)
all disable all indexes
...
...
@@ -863,11 +864,16 @@ int ha_myisam::enable_indexes()
void
ha_myisam
::
start_bulk_insert
(
ha_rows
rows
)
{
if
(
!
(
specialflag
&
SPECIAL_SAFE_MODE
))
{
THD
*
thd
=
current_thd
;
ulong
size
=
min
(
thd
->
variables
.
read_buff_size
,
table
->
avg_row_length
*
rows
);
mi_extra
(
file
,
HA_EXTRA_WRITE_CACHE
,
(
void
*
)
&
size
);
can_enable_indexes
=
(
file
->
s
->
state
.
key_map
==
set_bits
(
ulonglong
,
file
->
s
->
base
.
keys
));
if
(
!
(
specialflag
&
SPECIAL_SAFE_MODE
))
{
/*
Only disable old index if the table was empty and we are inserting
a lot of rows.
...
...
@@ -881,18 +887,16 @@ void ha_myisam::start_bulk_insert(ha_rows rows)
if
(
!
file
->
bulk_insert
&&
(
!
rows
||
rows
>=
MI_MIN_ROWS_TO_USE_BULK_INSERT
))
{
mi_init_bulk_insert
(
file
,
current_thd
->
variables
.
bulk_insert_buff_size
,
rows
);
mi_init_bulk_insert
(
file
,
thd
->
variables
.
bulk_insert_buff_size
,
rows
);
}
}
}
int
ha_myisam
::
end_bulk_insert
()
{
mi_end_bulk_insert
(
file
);
return
can_enable_indexes
?
enable_indexes
()
:
0
;
int
err
=
mi_extra
(
file
,
HA_EXTRA_NO_CACHE
,
0
);
return
err
?
err
:
can_enable_indexes
?
enable_indexes
()
:
0
;
}
...
...
sql/sql_insert.cc
View file @
6fc74e13
...
...
@@ -264,17 +264,8 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
thd
->
proc_info
=
"update"
;
if
(
duplic
!=
DUP_ERROR
)
table
->
file
->
extra
(
HA_EXTRA_IGNORE_DUP_KEY
);
if
((
lock_type
!=
TL_WRITE_DELAYED
&&
!
(
specialflag
&
SPECIAL_SAFE_MODE
))
&&
values_list
.
elements
>=
MIN_ROWS_TO_USE_BULK_INSERT
)
{
table
->
file
->
extra_opt
(
HA_EXTRA_WRITE_CACHE
,
min
(
thd
->
variables
.
read_buff_size
,
table
->
avg_row_length
*
values_list
.
elements
));
if
(
lock_type
!=
TL_WRITE_DELAYED
)
table
->
file
->
start_bulk_insert
(
values_list
.
elements
);
bulk_insert
=
1
;
}
else
bulk_insert
=
0
;
while
((
values
=
its
++
))
{
...
...
@@ -352,25 +343,11 @@ int mysql_insert(THD *thd,TABLE_LIST *table_list,
else
#endif
{
if
(
bulk_insert
)
{
if
(
table
->
file
->
extra
(
HA_EXTRA_NO_CACHE
))
{
if
(
!
error
)
{
table
->
file
->
print_error
(
my_errno
,
MYF
(
0
));
error
=
1
;
}
}
if
(
table
->
file
->
end_bulk_insert
())
{
if
(
!
error
)
if
(
table
->
file
->
end_bulk_insert
()
&&
!
error
)
{
table
->
file
->
print_error
(
my_errno
,
MYF
(
0
));
error
=
1
;
}
}
}
if
(
id
&&
values_list
.
elements
!=
1
)
thd
->
insert_id
(
id
);
// For update log
else
if
(
table
->
next_number_field
&&
info
.
copied
)
...
...
@@ -1439,8 +1416,6 @@ select_insert::prepare(List<Item> &values, SELECT_LEX_UNIT *u)
table
->
next_number_field
=
table
->
found_next_number_field
;
thd
->
count_cuted_fields
=
CHECK_FIELD_WARN
;
// calc cuted fields
thd
->
cuted_fields
=
0
;
if
(
info
.
handle_duplicates
!=
DUP_REPLACE
)
table
->
file
->
extra
(
HA_EXTRA_WRITE_CACHE
);
if
(
info
.
handle_duplicates
==
DUP_IGNORE
||
info
.
handle_duplicates
==
DUP_REPLACE
)
table
->
file
->
extra
(
HA_EXTRA_IGNORE_DUP_KEY
);
...
...
@@ -1497,7 +1472,6 @@ void select_insert::send_error(uint errcode,const char *err)
*/
DBUG_VOID_RETURN
;
}
table
->
file
->
extra
(
HA_EXTRA_NO_CACHE
);
table
->
file
->
end_bulk_insert
();
/*
If at least one row has been inserted/modified and will stay in the table
...
...
@@ -1532,7 +1506,6 @@ bool select_insert::send_eof()
int
error
,
error2
;
DBUG_ENTER
(
"select_insert::send_eof"
);
if
(
!
(
error
=
table
->
file
->
extra
(
HA_EXTRA_NO_CACHE
)))
error
=
table
->
file
->
end_bulk_insert
();
table
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
);
...
...
sql/sql_load.cc
View file @
6fc74e13
...
...
@@ -278,8 +278,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
table
->
timestamp_default_now
=
table
->
timestamp_on_update_now
=
0
;
table
->
next_number_field
=
table
->
found_next_number_field
;
VOID
(
table
->
file
->
extra_opt
(
HA_EXTRA_WRITE_CACHE
,
thd
->
variables
.
read_buff_size
));
if
(
handle_duplicates
==
DUP_IGNORE
||
handle_duplicates
==
DUP_REPLACE
)
table
->
file
->
extra
(
HA_EXTRA_IGNORE_DUP_KEY
);
...
...
@@ -291,8 +289,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
else
error
=
read_sep_field
(
thd
,
info
,
table
,
fields
,
read_info
,
*
enclosed
,
skip_lines
);
if
(
table
->
file
->
extra
(
HA_EXTRA_NO_CACHE
))
error
=
1
;
/* purecov: inspected */
if
(
table
->
file
->
end_bulk_insert
())
error
=
1
;
/* purecov: inspected */
table
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
);
...
...
sql/sql_table.cc
View file @
6fc74e13
...
...
@@ -2271,6 +2271,13 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
break
;
}
}
if
(
error
==
HA_ERR_WRONG_COMMAND
)
{
push_warning_printf
(
thd
,
MYSQL_ERROR
::
WARN_LEVEL_NOTE
,
ER_ILLEGAL_HA
,
ER
(
ER_ILLEGAL_HA
),
table
->
table_name
);
error
=
0
;
}
if
(
!
error
)
{
mysql_update_log
.
write
(
thd
,
thd
->
query
,
thd
->
query_length
);
...
...
@@ -2866,7 +2873,6 @@ copy_data_between_tables(TABLE *from,TABLE *to,
DBUG_RETURN
(
-
1
);
/* purecov: inspected */
to
->
file
->
external_lock
(
thd
,
F_WRLCK
);
to
->
file
->
extra
(
HA_EXTRA_WRITE_CACHE
);
from
->
file
->
info
(
HA_STATUS_VARIABLE
);
to
->
file
->
start_bulk_insert
(
from
->
file
->
records
);
...
...
@@ -2951,17 +2957,15 @@ copy_data_between_tables(TABLE *from,TABLE *to,
end_read_record
(
&
info
);
free_io_cache
(
from
);
delete
[]
copy
;
// This is never 0
uint
tmp_error
;
if
(
(
tmp_error
=
to
->
file
->
extra
(
HA_EXTRA_NO_CACHE
))
)
if
(
to
->
file
->
end_bulk_insert
()
&&
!
error
)
{
to
->
file
->
print_error
(
tmp_error
,
MYF
(
0
));
to
->
file
->
print_error
(
my_errno
,
MYF
(
0
));
error
=
1
;
}
to
->
file
->
extra
(
HA_EXTRA_NO_IGNORE_DUP_KEY
);
if
(
to
->
file
->
end_bulk_insert
())
error
=
1
;
tmp_error
=
ha_recovery_logging
(
thd
,
TRUE
);
ha_recovery_logging
(
thd
,
TRUE
);
/*
Ensure that the new table is saved properly to disk so that we
can do a rename
...
...
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