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
6b2cb10a
Commit
6b2cb10a
authored
Apr 10, 2007
by
gluh@mysql.com/eagle.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into mysql.com:/home/gluh/MySQL/Bugs/5.0.27069
parents
bd461b01
b80d373b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
8 deletions
+33
-8
mysql-test/r/strict.result
mysql-test/r/strict.result
+5
-0
mysql-test/t/strict.test
mysql-test/t/strict.test
+9
-0
sql/sql_table.cc
sql/sql_table.cc
+19
-8
No files found.
mysql-test/r/strict.result
View file @
6b2cb10a
...
@@ -1386,4 +1386,9 @@ ERROR 01000: Data truncated for column 'a' at row 1
...
@@ -1386,4 +1386,9 @@ ERROR 01000: Data truncated for column 'a' at row 1
insert into t1 values ('2E3x');
insert into t1 values ('2E3x');
ERROR 01000: Data truncated for column 'a' at row 1
ERROR 01000: Data truncated for column 'a' at row 1
drop table t1;
drop table t1;
set sql_mode='traditional';
create table t1 (f1 set('a','a'));
ERROR HY000: Column 'f1' has duplicated value 'a' in SET
create table t1 (f1 enum('a','a'));
ERROR HY000: Column 'f1' has duplicated value 'a' in ENUM
End of 5.0 tests
End of 5.0 tests
mysql-test/t/strict.test
View file @
6b2cb10a
...
@@ -1249,4 +1249,13 @@ insert into t1 values ('2000a');
...
@@ -1249,4 +1249,13 @@ insert into t1 values ('2000a');
insert
into
t1
values
(
'2E3x'
);
insert
into
t1
values
(
'2E3x'
);
drop
table
t1
;
drop
table
t1
;
#
# Bug#27069 set with identical elements are created
#
set
sql_mode
=
'traditional'
;
--
error
1291
create
table
t1
(
f1
set
(
'a'
,
'a'
));
--
error
1291
create
table
t1
(
f1
enum
(
'a'
,
'a'
));
--
echo
End
of
5.0
tests
--
echo
End
of
5.0
tests
sql/sql_table.cc
View file @
6b2cb10a
...
@@ -414,10 +414,11 @@ static int sort_keys(KEY *a, KEY *b)
...
@@ -414,10 +414,11 @@ static int sort_keys(KEY *a, KEY *b)
which has some duplicates on its right
which has some duplicates on its right
RETURN VALUES
RETURN VALUES
void
0 ok
1 Error
*/
*/
void
check_duplicates_in_interval
(
const
char
*
set_or_name
,
bool
check_duplicates_in_interval
(
const
char
*
set_or_name
,
const
char
*
name
,
TYPELIB
*
typelib
,
const
char
*
name
,
TYPELIB
*
typelib
,
CHARSET_INFO
*
cs
,
unsigned
int
*
dup_val_count
)
CHARSET_INFO
*
cs
,
unsigned
int
*
dup_val_count
)
{
{
...
@@ -433,6 +434,13 @@ void check_duplicates_in_interval(const char *set_or_name,
...
@@ -433,6 +434,13 @@ void check_duplicates_in_interval(const char *set_or_name,
tmp
.
count
--
;
tmp
.
count
--
;
if
(
find_type2
(
&
tmp
,
(
const
char
*
)
*
cur_value
,
*
cur_length
,
cs
))
if
(
find_type2
(
&
tmp
,
(
const
char
*
)
*
cur_value
,
*
cur_length
,
cs
))
{
{
if
((
current_thd
->
variables
.
sql_mode
&
(
MODE_STRICT_TRANS_TABLES
|
MODE_STRICT_ALL_TABLES
)))
{
my_error
(
ER_DUPLICATED_VALUE_IN_TYPE
,
MYF
(
0
),
name
,
*
cur_value
,
set_or_name
);
return
1
;
}
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_NOTE
,
push_warning_printf
(
current_thd
,
MYSQL_ERROR
::
WARN_LEVEL_NOTE
,
ER_DUPLICATED_VALUE_IN_TYPE
,
ER_DUPLICATED_VALUE_IN_TYPE
,
ER
(
ER_DUPLICATED_VALUE_IN_TYPE
),
ER
(
ER_DUPLICATED_VALUE_IN_TYPE
),
...
@@ -440,6 +448,7 @@ void check_duplicates_in_interval(const char *set_or_name,
...
@@ -440,6 +448,7 @@ void check_duplicates_in_interval(const char *set_or_name,
(
*
dup_val_count
)
++
;
(
*
dup_val_count
)
++
;
}
}
}
}
return
0
;
}
}
...
@@ -575,9 +584,10 @@ int prepare_create_field(create_field *sql_field,
...
@@ -575,9 +584,10 @@ int prepare_create_field(create_field *sql_field,
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
unireg_check
=
Field
::
INTERVAL_FIELD
;
sql_field
->
unireg_check
=
Field
::
INTERVAL_FIELD
;
check_duplicates_in_interval
(
"ENUM"
,
sql_field
->
field_name
,
if
(
check_duplicates_in_interval
(
"ENUM"
,
sql_field
->
field_name
,
sql_field
->
interval
,
sql_field
->
interval
,
sql_field
->
charset
,
&
dup_val_count
);
sql_field
->
charset
,
&
dup_val_count
))
DBUG_RETURN
(
1
);
break
;
break
;
case
FIELD_TYPE_SET
:
case
FIELD_TYPE_SET
:
sql_field
->
pack_flag
=
pack_length_to_packflag
(
sql_field
->
pack_length
)
|
sql_field
->
pack_flag
=
pack_length_to_packflag
(
sql_field
->
pack_length
)
|
...
@@ -585,9 +595,10 @@ int prepare_create_field(create_field *sql_field,
...
@@ -585,9 +595,10 @@ int prepare_create_field(create_field *sql_field,
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
if
(
sql_field
->
charset
->
state
&
MY_CS_BINSORT
)
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
pack_flag
|=
FIELDFLAG_BINARY
;
sql_field
->
unireg_check
=
Field
::
BIT_FIELD
;
sql_field
->
unireg_check
=
Field
::
BIT_FIELD
;
check_duplicates_in_interval
(
"SET"
,
sql_field
->
field_name
,
if
(
check_duplicates_in_interval
(
"SET"
,
sql_field
->
field_name
,
sql_field
->
interval
,
sql_field
->
interval
,
sql_field
->
charset
,
&
dup_val_count
);
sql_field
->
charset
,
&
dup_val_count
))
DBUG_RETURN
(
1
);
/* Check that count of unique members is not more then 64 */
/* Check that count of unique members is not more then 64 */
if
(
sql_field
->
interval
->
count
-
dup_val_count
>
sizeof
(
longlong
)
*
8
)
if
(
sql_field
->
interval
->
count
-
dup_val_count
>
sizeof
(
longlong
)
*
8
)
{
{
...
...
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