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
65ef7cc2
Commit
65ef7cc2
authored
Oct 20, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/mysql-4.1
parents
f4911002
7eee194d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
93 deletions
+20
-93
mysql-test/r/show_check.result
mysql-test/r/show_check.result
+7
-0
mysql-test/t/show_check.test
mysql-test/t/show_check.test
+13
-0
tests/mysql_client_test.c
tests/mysql_client_test.c
+0
-93
No files found.
mysql-test/r/show_check.result
View file @
65ef7cc2
...
@@ -513,3 +513,10 @@ t1 CREATE TABLE `t1` (
...
@@ -513,3 +513,10 @@ t1 CREATE TABLE `t1` (
KEY `c2` USING BTREE (`c2`)
KEY `c2` USING BTREE (`c2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
DROP TABLE t1;
flush tables;
SHOW TABLE STATUS like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 NULL NULL NULL NULL # # # # NULL NULL NULL NULL NULL NULL NULL NULL Incorrect information in file: './test/t1.frm'
show create table t1;
ERROR HY000: Incorrect information in file: './test/t1.frm'
drop table t1;
mysql-test/t/show_check.test
View file @
65ef7cc2
...
@@ -378,4 +378,17 @@ create table t1 (
...
@@ -378,4 +378,17 @@ create table t1 (
SHOW
CREATE
TABLE
t1
;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
# Test for BUG#93: 4.1 protocl crash on corupted frm and SHOW TABLE STATUS
flush
tables
;
# Create a junk frm file on disk
system
echo
"this is a junk file for test"
>>
var
/
master
-
data
/
test
/
t1
.
frm
;
--
replace_column
6
# 7 # 8 # 9 #
SHOW
TABLE
STATUS
like
't1'
;
--
error
1033
show
create
table
t1
;
drop
table
t1
;
# End of 4.1 tests
# End of 4.1 tests
tests/mysql_client_test.c
View file @
65ef7cc2
...
@@ -6899,98 +6899,6 @@ static void test_prepare_grant()
...
@@ -6899,98 +6899,6 @@ static void test_prepare_grant()
}
}
#endif
/* EMBEDDED_LIBRARY */
#endif
/* EMBEDDED_LIBRARY */
/*
Test a crash when invalid/corrupted .frm is used in the
SHOW TABLE STATUS
bug #93 (reported by serg@mysql.com).
*/
static
void
test_frm_bug
()
{
MYSQL_STMT
*
stmt
;
MYSQL_BIND
bind
[
2
];
MYSQL_RES
*
result
;
MYSQL_ROW
row
;
FILE
*
test_file
;
char
data_dir
[
FN_REFLEN
];
char
test_frm
[
FN_REFLEN
];
int
rc
;
myheader
(
"test_frm_bug"
);
mysql_autocommit
(
mysql
,
TRUE
);
rc
=
mysql_query
(
mysql
,
"drop table if exists test_frm_bug"
);
myquery
(
rc
);
rc
=
mysql_query
(
mysql
,
"flush tables"
);
myquery
(
rc
);
stmt
=
mysql_simple_prepare
(
mysql
,
"show variables like 'datadir'"
);
check_stmt
(
stmt
);
rc
=
mysql_stmt_execute
(
stmt
);
check_execute
(
stmt
,
rc
);
bind
[
0
].
buffer_type
=
MYSQL_TYPE_STRING
;
bind
[
0
].
buffer
=
data_dir
;
bind
[
0
].
buffer_length
=
FN_REFLEN
;
bind
[
0
].
is_null
=
0
;
bind
[
0
].
length
=
0
;
bind
[
1
]
=
bind
[
0
];
rc
=
mysql_stmt_bind_result
(
stmt
,
bind
);
check_execute
(
stmt
,
rc
);
rc
=
mysql_stmt_fetch
(
stmt
);
check_execute
(
stmt
,
rc
);
if
(
!
opt_silent
)
fprintf
(
stdout
,
"
\n
data directory: %s"
,
data_dir
);
rc
=
mysql_stmt_fetch
(
stmt
);
DIE_UNLESS
(
rc
==
MYSQL_NO_DATA
);
strxmov
(
test_frm
,
data_dir
,
"/"
,
current_db
,
"/"
,
"test_frm_bug.frm"
,
NullS
);
if
(
!
opt_silent
)
fprintf
(
stdout
,
"
\n
test_frm: %s"
,
test_frm
);
if
(
!
(
test_file
=
my_fopen
(
test_frm
,
(
int
)
(
O_RDWR
|
O_CREAT
),
MYF
(
MY_WME
))))
{
fprintf
(
stdout
,
"
\n
ERROR: my_fopen failed for '%s'"
,
test_frm
);
fprintf
(
stdout
,
"
\n
test cancelled"
);
exit
(
1
);
}
if
(
!
opt_silent
)
fprintf
(
test_file
,
"this is a junk file for test"
);
rc
=
mysql_query
(
mysql
,
"SHOW TABLE STATUS like 'test_frm_bug'"
);
myquery
(
rc
);
result
=
mysql_store_result
(
mysql
);
mytest
(
result
);
/* It can't be NULL */
rc
=
my_process_result_set
(
result
);
DIE_UNLESS
(
rc
==
1
);
mysql_data_seek
(
result
,
0
);
row
=
mysql_fetch_row
(
result
);
mytest
(
row
);
if
(
!
opt_silent
)
fprintf
(
stdout
,
"
\n
Comment: %s"
,
row
[
17
]);
DIE_UNLESS
(
row
[
17
]
!=
0
);
mysql_free_result
(
result
);
mysql_stmt_close
(
stmt
);
my_fclose
(
test_file
,
MYF
(
0
));
mysql_query
(
mysql
,
"drop table if exists test_frm_bug"
);
}
/* Test DECIMAL conversion */
/* Test DECIMAL conversion */
static
void
test_decimal_bug
()
static
void
test_decimal_bug
()
...
@@ -11976,7 +11884,6 @@ static struct my_tests_st my_tests[]= {
...
@@ -11976,7 +11884,6 @@ static struct my_tests_st my_tests[]= {
#ifndef EMBEDDED_LIBRARY
#ifndef EMBEDDED_LIBRARY
{
"test_prepare_grant"
,
test_prepare_grant
},
{
"test_prepare_grant"
,
test_prepare_grant
},
#endif
#endif
{
"test_frm_bug"
,
test_frm_bug
},
{
"test_explain_bug"
,
test_explain_bug
},
{
"test_explain_bug"
,
test_explain_bug
},
{
"test_decimal_bug"
,
test_decimal_bug
},
{
"test_decimal_bug"
,
test_decimal_bug
},
{
"test_nstmts"
,
test_nstmts
},
{
"test_nstmts"
,
test_nstmts
},
...
...
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