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
79ac77e4
Commit
79ac77e4
authored
May 18, 2005
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/mydev/mysql-4.1
into mysql.com:/home/mydev/mysql-4.1-4100
parents
4ac1a1ce
6f0ea859
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
3 deletions
+31
-3
mysql-test/r/merge.result
mysql-test/r/merge.result
+10
-0
mysql-test/t/merge.test
mysql-test/t/merge.test
+12
-0
sql/ha_myisammrg.h
sql/ha_myisammrg.h
+1
-1
sql/handler.h
sql/handler.h
+1
-0
sql/sql_insert.cc
sql/sql_insert.cc
+1
-1
sql/table.cc
sql/table.cc
+6
-1
No files found.
mysql-test/r/merge.result
View file @
79ac77e4
...
...
@@ -681,3 +681,13 @@ t3 1 a 1 a A NULL NULL NULL YES BTREE
t3 1 a 2 b A NULL NULL NULL YES BTREE
t3 1 a 3 c A NULL NULL NULL YES BTREE
drop table t1, t2, t3;
CREATE TABLE t1 ( a INT AUTO_INCREMENT PRIMARY KEY, b VARCHAR(10), UNIQUE (b) )
ENGINE=MyISAM;
CREATE TABLE t2 ( a INT AUTO_INCREMENT, b VARCHAR(10), INDEX (a), INDEX (b) )
ENGINE=MERGE UNION (t1) INSERT_METHOD=FIRST;
INSERT INTO t2 (b) VALUES (1) ON DUPLICATE KEY UPDATE b=2;
INSERT INTO t2 (b) VALUES (1) ON DUPLICATE KEY UPDATE b=3;
SELECT b FROM t2;
b
3
DROP TABLE t1, t2;
mysql-test/t/merge.test
View file @
79ac77e4
...
...
@@ -306,3 +306,15 @@ show index from t3;
drop
table
t1
,
t2
,
t3
;
#
# Bug#10400 - Improperly-defined MERGE table crashes with INSERT ... ON DUPLICATE KEY UPDATE
#
CREATE
TABLE
t1
(
a
INT
AUTO_INCREMENT
PRIMARY
KEY
,
b
VARCHAR
(
10
),
UNIQUE
(
b
)
)
ENGINE
=
MyISAM
;
CREATE
TABLE
t2
(
a
INT
AUTO_INCREMENT
,
b
VARCHAR
(
10
),
INDEX
(
a
),
INDEX
(
b
)
)
ENGINE
=
MERGE
UNION
(
t1
)
INSERT_METHOD
=
FIRST
;
INSERT
INTO
t2
(
b
)
VALUES
(
1
)
ON
DUPLICATE
KEY
UPDATE
b
=
2
;
INSERT
INTO
t2
(
b
)
VALUES
(
1
)
ON
DUPLICATE
KEY
UPDATE
b
=
3
;
SELECT
b
FROM
t2
;
DROP
TABLE
t1
,
t2
;
sql/ha_myisammrg.h
View file @
79ac77e4
...
...
@@ -37,7 +37,7 @@ class ha_myisammrg: public handler
{
return
(
HA_REC_NOT_IN_SEQ
|
HA_AUTO_PART_KEY
|
HA_READ_RND_SAME
|
HA_NULL_IN_KEY
|
HA_CAN_INDEX_BLOBS
|
HA_FILE_BASED
|
HA_CAN_INSERT_DELAYED
);
HA_CAN_INSERT_DELAYED
|
HA_ANY_INDEX_MAY_BE_UNIQUE
);
}
ulong
index_flags
(
uint
inx
,
uint
part
,
bool
all_parts
)
const
{
...
...
sql/handler.h
View file @
79ac77e4
...
...
@@ -73,6 +73,7 @@
#define HA_HAS_CHECKSUM (1 << 24)
/* Table data are stored in separate files (for lower_case_table_names) */
#define HA_FILE_BASED (1 << 26)
#define HA_ANY_INDEX_MAY_BE_UNIQUE (1 << 30)
/* bits in index_flags(index_number) for what you can do with index */
...
...
sql/sql_insert.cc
View file @
79ac77e4
...
...
@@ -682,7 +682,7 @@ int write_record(TABLE *table,COPY_INFO *info)
err:
if
(
key
)
my_
afree
(
key
);
my_
safe_afree
(
key
,
table
->
max_unique_length
,
MAX_KEY_LENGTH
);
info
->
last_errno
=
error
;
table
->
file
->
print_error
(
error
,
MYF
(
0
));
DBUG_RETURN
(
1
);
...
...
sql/table.cc
View file @
79ac77e4
...
...
@@ -688,7 +688,12 @@ int openfrm(const char *name, const char *alias, uint db_stat, uint prgflag,
set_if_bigger
(
outparam
->
max_key_length
,
keyinfo
->
key_length
+
keyinfo
->
key_parts
);
outparam
->
total_key_length
+=
keyinfo
->
key_length
;
if
(
keyinfo
->
flags
&
HA_NOSAME
)
/*
MERGE tables do not have unique indexes. But every key could be
an unique index on the underlying MyISAM table. (Bug #10400)
*/
if
((
keyinfo
->
flags
&
HA_NOSAME
)
||
(
ha_option
&
HA_ANY_INDEX_MAY_BE_UNIQUE
))
set_if_bigger
(
outparam
->
max_unique_length
,
keyinfo
->
key_length
);
}
if
(
primary_key
<
MAX_KEY
&&
...
...
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