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
d4438c99
Commit
d4438c99
authored
Oct 24, 2008
by
Davi Arnaut
Browse files
Options
Browse Files
Download
Plain Diff
Merge from mysql-5.1-5.1.29-rc into mysql-5.1-bugteam
parents
463c837c
256f41ed
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
59 additions
and
10 deletions
+59
-10
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+12
-0
mysql-test/r/binlog_format_basic.result
mysql-test/r/binlog_format_basic.result
+3
-0
mysql-test/t/alter_table.test
mysql-test/t/alter_table.test
+10
-0
mysql-test/t/binlog_format_basic.test
mysql-test/t/binlog_format_basic.test
+7
-0
sql/field.cc
sql/field.cc
+25
-10
sql/field.h
sql/field.h
+2
-0
No files found.
mysql-test/r/alter_table.result
View file @
d4438c99
...
...
@@ -1240,4 +1240,16 @@ select (@orig_max_data_length > @changed_max_data_length);
(@orig_max_data_length > @changed_max_data_length)
1
drop table t1;
CREATE TABLE t1(a INT AUTO_INCREMENT PRIMARY KEY,
b ENUM('a', 'b', 'c') NOT NULL);
INSERT INTO t1 (b) VALUES ('a'), ('c'), ('b'), ('b'), ('a');
ALTER TABLE t1 MODIFY b ENUM('a', 'z', 'b', 'c') NOT NULL;
SELECT * FROM t1;
a b
1 a
2 c
3 b
4 b
5 a
DROP TABLE t1;
End of 5.1 tests
mysql-test/r/binlog_format_basic.result
View file @
d4438c99
SELECT @@GLOBAL.binlog_format;
@@GLOBAL.binlog_format
STATEMENT
'#---------------------BS_STVARS_002_01----------------------#'
SELECT COUNT(@@GLOBAL.binlog_format);
COUNT(@@GLOBAL.binlog_format)
...
...
mysql-test/t/alter_table.test
View file @
d4438c99
...
...
@@ -977,4 +977,14 @@ select (@orig_max_data_length > @changed_max_data_length);
drop
table
t1
;
#
# Bug #23113: Different behavior on altering ENUM fields between 5.0 and 5.1
#
CREATE
TABLE
t1
(
a
INT
AUTO_INCREMENT
PRIMARY
KEY
,
b
ENUM
(
'a'
,
'b'
,
'c'
)
NOT
NULL
);
INSERT
INTO
t1
(
b
)
VALUES
(
'a'
),
(
'c'
),
(
'b'
),
(
'b'
),
(
'a'
);
ALTER
TABLE
t1
MODIFY
b
ENUM
(
'a'
,
'z'
,
'b'
,
'c'
)
NOT
NULL
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
mysql-test/t/binlog_format_basic.test
View file @
d4438c99
...
...
@@ -22,6 +22,13 @@
# #
###############################################################################
###################################################################
# BUG#39812: Make statement replication default for 5.1 (to match 5.0)
# We just verify that the default binlog_format is STATEMENT in 5.1.
# In 6.0, it should be MIXED.
###################################################################
SELECT
@@
GLOBAL
.
binlog_format
;
--
echo
'#---------------------BS_STVARS_002_01----------------------#'
####################################################################
# Displaying default value #
...
...
sql/field.cc
View file @
d4438c99
...
...
@@ -8783,28 +8783,43 @@ bool Field::eq_def(Field *field)
return
1
;
}
/**
@return
returns 1 if the fields are equally defined
*/
bool
Field_enum
::
eq_def
(
Field
*
field
)
{
if
(
!
Field
::
eq_def
(
field
))
return
0
;
TYPELIB
*
from_lib
=
((
Field_enum
*
)
field
)
->
typelib
;
return
compare_enum_values
(((
Field_enum
*
)
field
)
->
typelib
);
}
if
(
typelib
->
count
<
from_lib
->
count
)
return
0
;
for
(
uint
i
=
0
;
i
<
from_lib
->
count
;
i
++
)
bool
Field_enum
::
compare_enum_values
(
TYPELIB
*
values
)
{
if
(
typelib
->
count
!=
values
->
count
)
return
FALSE
;
for
(
uint
i
=
0
;
i
<
typelib
->
count
;
i
++
)
if
(
my_strnncoll
(
field_charset
,
(
const
uchar
*
)
typelib
->
type_names
[
i
],
strlen
(
typelib
->
type_names
[
i
]),
(
const
uchar
*
)
from_lib
->
type_names
[
i
],
strlen
(
from_lib
->
type_names
[
i
])))
return
0
;
return
1
;
(
const
uchar
*
)
typelib
->
type_names
[
i
],
typelib
->
type_lengths
[
i
],
(
const
uchar
*
)
values
->
type_names
[
i
],
values
->
type_lengths
[
i
]))
return
FALSE
;
return
TRUE
;
}
uint
Field_enum
::
is_equal
(
Create_field
*
new_field
)
{
if
(
!
Field_str
::
is_equal
(
new_field
))
return
0
;
return
compare_enum_values
(
new_field
->
interval
);
}
/**
@return
returns 1 if the fields are equally defined
...
...
sql/field.h
View file @
d4438c99
...
...
@@ -1853,6 +1853,8 @@ public:
CHARSET_INFO
*
sort_charset
(
void
)
const
{
return
&
my_charset_bin
;
}
private:
int
do_save_field_metadata
(
uchar
*
first_byte
);
bool
compare_enum_values
(
TYPELIB
*
values
);
uint
is_equal
(
Create_field
*
new_field
);
};
...
...
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