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
a65623b3
Commit
a65623b3
authored
May 12, 2017
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-11883 MariaDB crashes with out-of-memory when query information_schema
CSV engine didn't expect CSM files to be read-only
parent
71b45032
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
58 additions
and
6 deletions
+58
-6
mysql-test/suite/csv/read_only.result
mysql-test/suite/csv/read_only.result
+30
-0
mysql-test/suite/csv/read_only.test
mysql-test/suite/csv/read_only.test
+19
-0
storage/csv/ha_tina.cc
storage/csv/ha_tina.cc
+9
-6
No files found.
mysql-test/suite/csv/read_only.result
0 → 100644
View file @
a65623b3
create table t1 (a int not null) engine=csv;
insert t1 values (1),(2);
flush tables;
select * from information_schema.tables where table_schema='test';
TABLE_CATALOG def
TABLE_SCHEMA test
TABLE_NAME t1
TABLE_TYPE BASE TABLE
ENGINE NULL
VERSION NULL
ROW_FORMAT NULL
TABLE_ROWS NULL
AVG_ROW_LENGTH NULL
DATA_LENGTH NULL
MAX_DATA_LENGTH NULL
INDEX_LENGTH NULL
DATA_FREE NULL
AUTO_INCREMENT NULL
CREATE_TIME NULL
UPDATE_TIME NULL
CHECK_TIME NULL
TABLE_COLLATION NULL
CHECKSUM NULL
CREATE_OPTIONS NULL
TABLE_COMMENT File './test/t1.CSM' not found (Errcode: 13 "Permission denied")
Warnings:
Level Warning
Code 29
Message File './test/t1.CSM' not found (Errcode: 13 "Permission denied")
drop table t1;
mysql-test/suite/csv/read_only.test
0 → 100644
View file @
a65623b3
#
# MDEV-11883 MariaDB crashes with out-of-memory when query information_schema
#
source
include
/
have_csv
.
inc
;
let
datadir
=
`select @@datadir`
;
create
table
t1
(
a
int
not
null
)
engine
=
csv
;
insert
t1
values
(
1
),(
2
);
flush
tables
;
chmod
0400
$datadir
/
test
/
t1
.
CSM
;
chmod
0400
$datadir
/
test
/
t1
.
CSV
;
--
replace_result
$datadir
./
query_vertical
select
*
from
information_schema
.
tables
where
table_schema
=
'test'
;
drop
table
t1
;
storage/csv/ha_tina.cc
View file @
a65623b3
...
...
@@ -289,7 +289,7 @@ static int read_meta_file(File meta_file, ha_rows *rows)
mysql_file_seek
(
meta_file
,
0
,
MY_SEEK_SET
,
MYF
(
0
));
if
(
mysql_file_read
(
meta_file
,
(
uchar
*
)
meta_buffer
,
META_BUFFER_SIZE
,
0
)
!=
META_BUFFER_SIZE
)
DBUG_RETURN
(
HA_ERR_CRASHED_ON_USAGE
);
DBUG_RETURN
(
my_errno
=
HA_ERR_CRASHED_ON_USAGE
);
/*
Parse out the meta data, we ignore version at the moment
...
...
@@ -418,10 +418,13 @@ static int free_share(TINA_SHARE *share)
int
result_code
=
0
;
if
(
!--
share
->
use_count
){
/* Write the meta file. Mark it as crashed if needed. */
(
void
)
write_meta_file
(
share
->
meta_file
,
share
->
rows_recorded
,
share
->
crashed
?
TRUE
:
FALSE
);
if
(
mysql_file_close
(
share
->
meta_file
,
MYF
(
0
)))
result_code
=
1
;
if
(
share
->
meta_file
!=
-
1
)
{
(
void
)
write_meta_file
(
share
->
meta_file
,
share
->
rows_recorded
,
share
->
crashed
?
TRUE
:
FALSE
);
if
(
mysql_file_close
(
share
->
meta_file
,
MYF
(
0
)))
result_code
=
1
;
}
if
(
share
->
tina_write_opened
)
{
if
(
mysql_file_close
(
share
->
tina_write_filedes
,
MYF
(
0
)))
...
...
@@ -930,7 +933,7 @@ int ha_tina::open(const char *name, int mode, uint open_options)
if
(
share
->
crashed
&&
!
(
open_options
&
HA_OPEN_FOR_REPAIR
))
{
free_share
(
share
);
DBUG_RETURN
(
HA_ERR_CRASHED_ON_USAGE
);
DBUG_RETURN
(
my_errno
?
my_errno
:
HA_ERR_CRASHED_ON_USAGE
);
}
local_data_file_version
=
share
->
data_file_version
;
...
...
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