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
a2fad11c
Commit
a2fad11c
authored
Jun 21, 2006
by
mskold@linux.site
Browse files
Options
Browse Files
Download
Plain Diff
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/home/marty/MySQL/mysql-5.1
parents
c360810d
7704d973
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
5 deletions
+54
-5
mysql-test/r/ndb_replace.result
mysql-test/r/ndb_replace.result
+22
-1
mysql-test/t/ndb_replace.test
mysql-test/t/ndb_replace.test
+28
-2
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+3
-1
sql/ha_ndbcluster.h
sql/ha_ndbcluster.h
+1
-1
No files found.
mysql-test/r/ndb_replace.result
View file @
a2fad11c
drop table if exists t1;
drop table if exists t1
,t2
;
CREATE TABLE t1 (
CREATE TABLE t1 (
gesuchnr int(11) DEFAULT '0' NOT NULL,
gesuchnr int(11) DEFAULT '0' NOT NULL,
benutzer_id int(11) DEFAULT '0' NOT NULL,
benutzer_id int(11) DEFAULT '0' NOT NULL,
...
@@ -31,3 +31,24 @@ SELECT * from t1 ORDER BY i;
...
@@ -31,3 +31,24 @@ SELECT * from t1 ORDER BY i;
i j k
i j k
3 1 42
3 1 42
17 2 NULL
17 2 NULL
CREATE TABLE t2 (a INT(11) NOT NULL,
b INT(11) NOT NULL,
c INT(11) NOT NULL,
x TEXT,
y TEXT,
z TEXT,
id INT(10) unsigned NOT NULL AUTO_INCREMENT,
i INT(11) DEFAULT NULL,
PRIMARY KEY (id),
UNIQUE KEY a (a,b,c)
) ENGINE=ndbcluster;
REPLACE INTO t2 (a,b,c,x,y,z,i) VALUES (1,1,1,'a','a','a',1),(1,1,1,'b','b','b',2), (1,1,1,'c','c','c',3);
SELECT * FROM t2 ORDER BY id;
a b c x y z id i
1 1 1 c c c 3 3
REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'a','a','a',1);
REPLACE INTO t2(a,b,c,x,y,z,i) values (1,1,1,'b','b','b',2);
SELECT * FROM t2 ORDER BY id;
a b c x y z id i
1 1 1 b b b 5 2
DROP TABLE t2;
mysql-test/t/ndb_replace.test
View file @
a2fad11c
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
#
#
--
disable_warnings
--
disable_warnings
drop
table
if
exists
t1
;
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
--
enable_warnings
CREATE
TABLE
t1
(
CREATE
TABLE
t1
(
...
@@ -27,6 +27,8 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
...
@@ -27,6 +27,8 @@ replace into t1 (gesuchnr,benutzer_id) values (1,1);
select
*
from
t1
order
by
gesuchnr
;
select
*
from
t1
order
by
gesuchnr
;
drop
table
t1
;
drop
table
t1
;
# End of 4.1 tests
# bug#17431
# bug#17431
CREATE
TABLE
t1
(
i
INT
PRIMARY
KEY
AUTO_INCREMENT
,
CREATE
TABLE
t1
(
i
INT
PRIMARY
KEY
AUTO_INCREMENT
,
j
INT
,
j
INT
,
...
@@ -38,4 +40,28 @@ REPLACE INTO t1 (j,k) VALUES (1,42);
...
@@ -38,4 +40,28 @@ REPLACE INTO t1 (j,k) VALUES (1,42);
REPLACE
INTO
t1
(
i
,
j
)
VALUES
(
17
,
2
);
REPLACE
INTO
t1
(
i
,
j
)
VALUES
(
17
,
2
);
SELECT
*
from
t1
ORDER
BY
i
;
SELECT
*
from
t1
ORDER
BY
i
;
# End of 4.1 tests
# bug#19906
CREATE
TABLE
t2
(
a
INT
(
11
)
NOT
NULL
,
b
INT
(
11
)
NOT
NULL
,
c
INT
(
11
)
NOT
NULL
,
x
TEXT
,
y
TEXT
,
z
TEXT
,
id
INT
(
10
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
i
INT
(
11
)
DEFAULT
NULL
,
PRIMARY
KEY
(
id
),
UNIQUE
KEY
a
(
a
,
b
,
c
)
)
ENGINE
=
ndbcluster
;
REPLACE
INTO
t2
(
a
,
b
,
c
,
x
,
y
,
z
,
i
)
VALUES
(
1
,
1
,
1
,
'a'
,
'a'
,
'a'
,
1
),(
1
,
1
,
1
,
'b'
,
'b'
,
'b'
,
2
),
(
1
,
1
,
1
,
'c'
,
'c'
,
'c'
,
3
);
SELECT
*
FROM
t2
ORDER
BY
id
;
REPLACE
INTO
t2
(
a
,
b
,
c
,
x
,
y
,
z
,
i
)
values
(
1
,
1
,
1
,
'a'
,
'a'
,
'a'
,
1
);
REPLACE
INTO
t2
(
a
,
b
,
c
,
x
,
y
,
z
,
i
)
values
(
1
,
1
,
1
,
'b'
,
'b'
,
'b'
,
2
);
SELECT
*
FROM
t2
ORDER
BY
id
;
DROP
TABLE
t2
;
sql/ha_ndbcluster.cc
View file @
a2fad11c
...
@@ -735,7 +735,7 @@ int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg)
...
@@ -735,7 +735,7 @@ int g_get_ndb_blobs_value(NdbBlob *ndb_blob, void *arg)
ha_ndbcluster
*
ha
=
(
ha_ndbcluster
*
)
arg
;
ha_ndbcluster
*
ha
=
(
ha_ndbcluster
*
)
arg
;
int
ret
=
get_ndb_blobs_value
(
ha
->
table
,
ha
->
m_value
,
int
ret
=
get_ndb_blobs_value
(
ha
->
table
,
ha
->
m_value
,
ha
->
m_blobs_buffer
,
ha
->
m_blobs_buffer_size
,
ha
->
m_blobs_buffer
,
ha
->
m_blobs_buffer_size
,
0
);
ha
->
m_blobs_offset
);
DBUG_RETURN
(
ret
);
DBUG_RETURN
(
ret
);
}
}
...
@@ -864,6 +864,7 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field,
...
@@ -864,6 +864,7 @@ int ha_ndbcluster::get_ndb_value(NdbOperation *ndb_op, Field *field,
if
(
ndb_blob
!=
NULL
)
if
(
ndb_blob
!=
NULL
)
{
{
// Set callback
// Set callback
m_blobs_offset
=
buf
-
(
byte
*
)
table
->
record
[
0
];
void
*
arg
=
(
void
*
)
this
;
void
*
arg
=
(
void
*
)
this
;
DBUG_RETURN
(
ndb_blob
->
setActiveHook
(
g_get_ndb_blobs_value
,
arg
)
!=
0
);
DBUG_RETURN
(
ndb_blob
->
setActiveHook
(
g_get_ndb_blobs_value
,
arg
)
!=
0
);
}
}
...
@@ -5477,6 +5478,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE_SHARE *table_arg):
...
@@ -5477,6 +5478,7 @@ ha_ndbcluster::ha_ndbcluster(TABLE_SHARE *table_arg):
m_ops_pending
(
0
),
m_ops_pending
(
0
),
m_skip_auto_increment
(
TRUE
),
m_skip_auto_increment
(
TRUE
),
m_blobs_pending
(
0
),
m_blobs_pending
(
0
),
m_blobs_offset
(
0
),
m_blobs_buffer
(
0
),
m_blobs_buffer
(
0
),
m_blobs_buffer_size
(
0
),
m_blobs_buffer_size
(
0
),
m_dupkey
((
uint
)
-
1
),
m_dupkey
((
uint
)
-
1
),
...
...
sql/ha_ndbcluster.h
View file @
a2fad11c
...
@@ -798,7 +798,6 @@ private:
...
@@ -798,7 +798,6 @@ private:
int
get_ndb_value
(
NdbOperation
*
,
Field
*
field
,
uint
fieldnr
,
byte
*
);
int
get_ndb_value
(
NdbOperation
*
,
Field
*
field
,
uint
fieldnr
,
byte
*
);
int
get_ndb_partition_id
(
NdbOperation
*
);
int
get_ndb_partition_id
(
NdbOperation
*
);
friend
int
g_get_ndb_blobs_value
(
NdbBlob
*
ndb_blob
,
void
*
arg
);
friend
int
g_get_ndb_blobs_value
(
NdbBlob
*
ndb_blob
,
void
*
arg
);
int
get_ndb_blobs_value
(
NdbBlob
*
last_ndb_blob
);
int
set_primary_key
(
NdbOperation
*
op
,
const
byte
*
key
);
int
set_primary_key
(
NdbOperation
*
op
,
const
byte
*
key
);
int
set_primary_key_from_record
(
NdbOperation
*
op
,
const
byte
*
record
);
int
set_primary_key_from_record
(
NdbOperation
*
op
,
const
byte
*
record
);
int
set_index_key_from_record
(
NdbOperation
*
op
,
const
byte
*
record
,
int
set_index_key_from_record
(
NdbOperation
*
op
,
const
byte
*
record
,
...
@@ -883,6 +882,7 @@ private:
...
@@ -883,6 +882,7 @@ private:
ha_rows
m_ops_pending
;
ha_rows
m_ops_pending
;
bool
m_skip_auto_increment
;
bool
m_skip_auto_increment
;
bool
m_blobs_pending
;
bool
m_blobs_pending
;
my_ptrdiff_t
m_blobs_offset
;
// memory for blobs in one tuple
// memory for blobs in one tuple
char
*
m_blobs_buffer
;
char
*
m_blobs_buffer
;
uint32
m_blobs_buffer_size
;
uint32
m_blobs_buffer_size
;
...
...
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