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
ce4cab46
Commit
ce4cab46
authored
May 24, 2006
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0
into april.(none):/home/svoj/devel/mysql/BUG17001/mysql-5.0
parents
5ec9cff7
3ebf1916
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
3 deletions
+22
-3
heap/hp_write.c
heap/hp_write.c
+1
-1
mysql-test/r/heap_btree.result
mysql-test/r/heap_btree.result
+3
-0
mysql-test/t/heap_btree.test
mysql-test/t/heap_btree.test
+8
-0
sql/sql_table.cc
sql/sql_table.cc
+10
-2
No files found.
heap/hp_write.c
View file @
ce4cab46
...
@@ -105,7 +105,7 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
...
@@ -105,7 +105,7 @@ int hp_rb_write_key(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *record,
custom_arg
.
key_length
=
hp_rb_make_key
(
keyinfo
,
info
->
recbuf
,
record
,
recpos
);
custom_arg
.
key_length
=
hp_rb_make_key
(
keyinfo
,
info
->
recbuf
,
record
,
recpos
);
if
(
keyinfo
->
flag
&
HA_NOSAME
)
if
(
keyinfo
->
flag
&
HA_NOSAME
)
{
{
custom_arg
.
search_flag
=
SEARCH_FIND
|
SEARCH_
SAME
|
SEARCH_
UPDATE
;
custom_arg
.
search_flag
=
SEARCH_FIND
|
SEARCH_UPDATE
;
keyinfo
->
rb_tree
.
flag
=
TREE_NO_DUPS
;
keyinfo
->
rb_tree
.
flag
=
TREE_NO_DUPS
;
}
}
else
else
...
...
mysql-test/r/heap_btree.result
View file @
ce4cab46
...
@@ -256,3 +256,6 @@ SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE()
...
@@ -256,3 +256,6 @@ SELECT INDEX_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA=DATABASE()
INDEX_LENGTH
INDEX_LENGTH
21
21
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT, UNIQUE USING BTREE(a)) ENGINE=MEMORY;
INSERT INTO t1 VALUES(NULL),(NULL);
DROP TABLE t1;
mysql-test/t/heap_btree.test
View file @
ce4cab46
...
@@ -176,4 +176,12 @@ UPDATE t1 SET val=1;
...
@@ -176,4 +176,12 @@ UPDATE t1 SET val=1;
SELECT
INDEX_LENGTH
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_SCHEMA
=
DATABASE
()
AND
TABLE_NAME
=
't1'
;
SELECT
INDEX_LENGTH
FROM
INFORMATION_SCHEMA
.
TABLES
WHERE
TABLE_SCHEMA
=
DATABASE
()
AND
TABLE_NAME
=
't1'
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
#
# BUG#12873 - BTREE index on MEMORY table with multiple NULL values doesn't
# work properly
#
CREATE
TABLE
t1
(
a
INT
,
UNIQUE
USING
BTREE
(
a
))
ENGINE
=
MEMORY
;
INSERT
INTO
t1
VALUES
(
NULL
),(
NULL
);
DROP
TABLE
t1
;
# End of 4.1 tests
# End of 4.1 tests
sql/sql_table.cc
View file @
ce4cab46
...
@@ -3140,7 +3140,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
...
@@ -3140,7 +3140,7 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
uint
db_create_options
,
used_fields
;
uint
db_create_options
,
used_fields
;
enum
db_type
old_db_type
,
new_db_type
;
enum
db_type
old_db_type
,
new_db_type
;
bool
need_copy_table
;
bool
need_copy_table
;
bool
no_table_reopen
=
FALSE
;
bool
no_table_reopen
=
FALSE
,
varchar
=
FALSE
;
DBUG_ENTER
(
"mysql_alter_table"
);
DBUG_ENTER
(
"mysql_alter_table"
);
thd
->
proc_info
=
"init"
;
thd
->
proc_info
=
"init"
;
...
@@ -3344,6 +3344,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
...
@@ -3344,6 +3344,8 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
Field
**
f_ptr
,
*
field
;
Field
**
f_ptr
,
*
field
;
for
(
f_ptr
=
table
->
field
;
(
field
=
*
f_ptr
)
;
f_ptr
++
)
for
(
f_ptr
=
table
->
field
;
(
field
=
*
f_ptr
)
;
f_ptr
++
)
{
{
if
(
field
->
type
()
==
MYSQL_TYPE_STRING
)
varchar
=
TRUE
;
/* Check if field should be dropped */
/* Check if field should be dropped */
Alter_drop
*
drop
;
Alter_drop
*
drop
;
drop_it
.
rewind
();
drop_it
.
rewind
();
...
@@ -3605,12 +3607,18 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
...
@@ -3605,12 +3607,18 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name,
better have a negative test here, instead of positive, like
better have a negative test here, instead of positive, like
alter_info->flags & ALTER_ADD_COLUMN|ALTER_ADD_INDEX|...
alter_info->flags & ALTER_ADD_COLUMN|ALTER_ADD_INDEX|...
so that ALTER TABLE won't break when somebody will add new flag
so that ALTER TABLE won't break when somebody will add new flag
MySQL uses frm version to determine the type of the data fields and
their layout. See Field_string::type() for details.
Thus, if the table is too old we may have to rebuild the data to
update the layout.
*/
*/
need_copy_table
=
(
alter_info
->
flags
&
need_copy_table
=
(
alter_info
->
flags
&
~
(
ALTER_CHANGE_COLUMN_DEFAULT
|
ALTER_OPTIONS
)
||
~
(
ALTER_CHANGE_COLUMN_DEFAULT
|
ALTER_OPTIONS
)
||
(
create_info
->
used_fields
&
(
create_info
->
used_fields
&
~
(
HA_CREATE_USED_COMMENT
|
HA_CREATE_USED_PASSWORD
))
||
~
(
HA_CREATE_USED_COMMENT
|
HA_CREATE_USED_PASSWORD
))
||
table
->
s
->
tmp_table
);
table
->
s
->
tmp_table
||
(
table
->
s
->
frm_version
<
FRM_VER_TRUE_VARCHAR
&&
varchar
));
create_info
->
frm_only
=
!
need_copy_table
;
create_info
->
frm_only
=
!
need_copy_table
;
/*
/*
...
...
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