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
9e2c26b0
Commit
9e2c26b0
authored
3 years ago
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-26351 segfault - (MARIA_HA *) 0x0 in ha_maria::extra
don't let Aria create a table that it cannot open
parent
1b8bb441
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
mysql-test/r/tmp_table_error.result
mysql-test/r/tmp_table_error.result
+1
-1
mysql-test/t/tmp_table_error.test
mysql-test/t/tmp_table_error.test
+1
-1
storage/maria/ma_create.c
storage/maria/ma_create.c
+3
-3
No files found.
mysql-test/r/tmp_table_error.result
View file @
9e2c26b0
...
...
@@ -2630,5 +2630,5 @@ b as c2624,
b as c2626
from t1
) as tt1;
ERROR
HY000: Index for table 'tmp' is corrupt; try to repair it
ERROR
0A000: Aria table 'tmp' has too many columns and/or indexes and/or unique constraints.
drop table t1;
This diff is collapsed.
Click to expand it.
mysql-test/t/tmp_table_error.test
View file @
9e2c26b0
...
...
@@ -6,7 +6,7 @@ create table t1 (
)
engine
=
innodb
;
--
replace_regex
/
'.*'
/
'tmp'
/
--
error
1
26
--
error
1
40
create
table
t2
as
select
1
...
...
This diff is collapsed.
Click to expand it.
storage/maria/ma_create.c
View file @
9e2c26b0
...
...
@@ -716,9 +716,10 @@ int maria_create(const char *name, enum data_file_type datafile_type,
share
.
base
.
extra_options
|=
MA_EXTRA_OPTIONS_INSERT_ORDER
;
}
share
.
state
.
state
.
key_file_length
=
MY_ALIGN
(
info_length
,
maria_block_size
);
DBUG_PRINT
(
"info"
,
(
"info_length: %u"
,
info_length
));
/* There are only 16 bits for the total header length. */
if
(
info
_length
>
65535
)
if
(
share
.
state
.
state
.
key_file
_length
>
65535
)
{
my_printf_error
(
HA_WRONG_CREATE_OPTION
,
"Aria table '%s' has too many columns and/or "
...
...
@@ -775,8 +776,7 @@ int maria_create(const char *name, enum data_file_type datafile_type,
maria_set_all_keys_active
(
share
.
state
.
key_map
,
keys
);
share
.
base
.
keystart
=
share
.
state
.
state
.
key_file_length
=
MY_ALIGN
(
info_length
,
maria_block_size
);
share
.
base
.
keystart
=
share
.
state
.
state
.
key_file_length
;
share
.
base
.
max_key_block_length
=
maria_block_size
;
share
.
base
.
max_key_length
=
ALIGN_SIZE
(
max_key_length
+
4
);
share
.
base
.
records
=
ci
->
max_rows
;
...
...
This diff is collapsed.
Click to expand it.
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