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
37a64e5c
Commit
37a64e5c
authored
Jan 09, 2008
by
gni@dev3-221.dev.cn.tlan
Browse files
Options
Browse Files
Download
Plain Diff
Merge gni@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb-bj
into dev3-221.dev.cn.tlan:/home/ngb/mysql/mysql-5.0/bug29851
parents
b1d880ea
44472d42
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
1 deletion
+59
-1
mysql-test/r/ndb_alter_table2.result
mysql-test/r/ndb_alter_table2.result
+19
-0
mysql-test/t/ndb_alter_table2.test
mysql-test/t/ndb_alter_table2.test
+31
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+9
-1
No files found.
mysql-test/r/ndb_alter_table2.result
View file @
37a64e5c
...
...
@@ -40,3 +40,22 @@ a b c
select * from t1;
a b c
drop table t1;
DROP TABLE IF EXISTS truncate_test;
CREATE TABLE truncate_test (
i INT PRIMARY KEY,
a INT,
b VARCHAR(11),
UNIQUE KEY (a)
) ENGINE = NDB;
INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
TRUNCATE truncate_test;
INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
SELECT * FROM truncate_test;
i a b
1 1 test
INSERT INTO truncate_test VALUES (1, 1, 'test') ON DUPLICATE KEY UPDATE b = 'new';
SELECT * FROM truncate_test;
i a b
1 1 new
DROP TABLE truncate_test;
mysql-test/t/ndb_alter_table2.test
View file @
37a64e5c
...
...
@@ -81,3 +81,34 @@ select * from t1;
select
*
from
t1
;
drop
table
t1
;
#For BUG#29851 TRUNCATE causes error 4350 from cluster in INSERT... ON DUPLICATE KEY UPDATE
connection
con1
;
--
disable_warnings
DROP
TABLE
IF
EXISTS
truncate_test
;
--
enable_warnings
CREATE
TABLE
truncate_test
(
i
INT
PRIMARY
KEY
,
a
INT
,
b
VARCHAR
(
11
),
UNIQUE
KEY
(
a
)
)
ENGINE
=
NDB
;
INSERT
INTO
truncate_test
VALUES
(
1
,
1
,
'test'
)
ON
DUPLICATE
KEY
UPDATE
b
=
'new'
;
INSERT
INTO
truncate_test
VALUES
(
1
,
1
,
'test'
)
ON
DUPLICATE
KEY
UPDATE
b
=
'new'
;
connection
con2
;
TRUNCATE
truncate_test
;
connection
con1
;
INSERT
INTO
truncate_test
VALUES
(
1
,
1
,
'test'
)
ON
DUPLICATE
KEY
UPDATE
b
=
'new'
;
SELECT
*
FROM
truncate_test
;
connection
con2
;
INSERT
INTO
truncate_test
VALUES
(
1
,
1
,
'test'
)
ON
DUPLICATE
KEY
UPDATE
b
=
'new'
;
SELECT
*
FROM
truncate_test
;
DROP
TABLE
truncate_test
;
sql/ha_ndbcluster.cc
View file @
37a64e5c
...
...
@@ -439,7 +439,8 @@ void ha_ndbcluster::no_uncommitted_rows_reset(THD *thd)
void
ha_ndbcluster
::
invalidate_dictionary_cache
(
bool
global
)
{
NDBDICT
*
dict
=
get_ndb
()
->
getDictionary
();
Ndb
*
ndb
=
get_ndb
();
NDBDICT
*
dict
=
ndb
->
getDictionary
();
DBUG_ENTER
(
"invalidate_dictionary_cache"
);
DBUG_PRINT
(
"info"
,
(
"invalidating %s"
,
m_tabname
));
...
...
@@ -459,6 +460,7 @@ void ha_ndbcluster::invalidate_dictionary_cache(bool global)
}
else
dict
->
removeCachedTable
(
m_tabname
);
build_index_list
(
ndb
,
table
,
ILBP_OPEN
);
table
->
s
->
version
=
0L
;
/* Free when thread is ready */
/* Invalidate indexes */
for
(
uint
i
=
0
;
i
<
table
->
s
->
keys
;
i
++
)
...
...
@@ -470,17 +472,23 @@ void ha_ndbcluster::invalidate_dictionary_cache(bool global)
switch
(
idx_type
)
{
case
PRIMARY_KEY_ORDERED_INDEX
:
case
ORDERED_INDEX
:
if
(
!
index
)
break
;
if
(
global
)
dict
->
invalidateIndex
(
index
->
getName
(),
m_tabname
);
else
dict
->
removeCachedIndex
(
index
->
getName
(),
m_tabname
);
break
;
case
UNIQUE_ORDERED_INDEX
:
if
(
!
index
)
break
;
if
(
global
)
dict
->
invalidateIndex
(
index
->
getName
(),
m_tabname
);
else
dict
->
removeCachedIndex
(
index
->
getName
(),
m_tabname
);
case
UNIQUE_INDEX
:
if
(
!
unique_index
)
break
;
if
(
global
)
dict
->
invalidateIndex
(
unique_index
->
getName
(),
m_tabname
);
else
...
...
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