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
27a658b2
Commit
27a658b2
authored
Oct 26, 2004
by
gluh@gluh.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #6166: index prefix length of 0 not rejected
parent
47788e9e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
1 deletion
+26
-1
mysql-test/r/key.result
mysql-test/r/key.result
+2
-0
mysql-test/t/key.test
mysql-test/t/key.test
+11
-0
sql/sql_yacc.yy
sql/sql_yacc.yy
+13
-1
No files found.
mysql-test/r/key.result
View file @
27a658b2
...
...
@@ -305,3 +305,5 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
create table t1 (c char(10), index (c(0)));
ERROR HY000: Key part 'c' length cannot be 0
mysql-test/t/key.test
View file @
27a658b2
...
...
@@ -285,3 +285,14 @@ check table t1;
drop
table
t1
;
#
# Bug 6166: index prefix length of 0 not rejected
#
# this test should fail in 5.0
# to fix it, remove #ifdef in
# file sql_yacc.yy(key_part)
# create dedicated error code for this and
# and change my_printf_error() to my_error
--
error
1105
create
table
t1
(
c
char
(
10
),
index
(
c
(
0
)));
sql/sql_yacc.yy
View file @
27a658b2
...
...
@@ -1817,7 +1817,19 @@ key_list:
key_part:
ident { $$=new key_part_spec($1.str); }
| ident '(' NUM ')' { $$=new key_part_spec($1.str,(uint) atoi($3.str)); };
| ident '(' NUM ')'
{
int key_part_len= atoi($3.str);
#ifdef MYSQL_VERSION_ID < 50000
if (!key_part_len)
{
my_printf_error(ER_UNKNOWN_ERROR,
"Key part '%s' length cannot be 0",
MYF(0), $1.str);
}
#endif
$$=new key_part_spec($1.str,(uint) key_part_len);
};
opt_ident:
/* empty */ { $$=(char*) 0; } /* Defaultlength */
...
...
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