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
9e56779f
Commit
9e56779f
authored
Dec 01, 2006
by
mskold/marty@linux.site
Browse files
Options
Browse Files
Download
Plain Diff
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1
into mysql.com:/windows/Linux_space/MySQL/mysql-5.1
parents
6dc7e55e
5f84f3f4
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
33 deletions
+93
-33
mysql-test/r/ndb_update.result
mysql-test/r/ndb_update.result
+8
-0
mysql-test/t/ndb_index_unique.test
mysql-test/t/ndb_index_unique.test
+14
-1
mysql-test/t/ndb_update.test
mysql-test/t/ndb_update.test
+5
-0
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+16
-0
storage/ndb/src/common/util/socket_io.cpp
storage/ndb/src/common/util/socket_io.cpp
+50
-32
No files found.
mysql-test/r/ndb_update.result
View file @
9e56779f
...
@@ -17,6 +17,14 @@ pk1 b c
...
@@ -17,6 +17,14 @@ pk1 b c
0 0 0
0 0 0
2 2 2
2 2 2
4 1 1
4 1 1
UPDATE t1 set pk1 = 4 where pk1 = 2;
ERROR 23000: Duplicate entry '4' for key 1
UPDATE IGNORE t1 set pk1 = 4 where pk1 = 2;
select * from t1 order by pk1;
pk1 b c
0 0 0
2 2 2
4 1 1
UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
UPDATE t1 set pk1 = 1, c = 2 where pk1 = 4;
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
select * from t1 order by pk1;
select * from t1 order by pk1;
...
...
mysql-test/t/ndb_index_unique.test
View file @
9e56779f
...
@@ -91,7 +91,6 @@ select * from t2 order by a;
...
@@ -91,7 +91,6 @@ select * from t2 order by a;
drop
table
t2
;
drop
table
t2
;
--
error
1121
CREATE
TABLE
t2
(
CREATE
TABLE
t2
(
a
int
unsigned
NOT
NULL
PRIMARY
KEY
,
a
int
unsigned
NOT
NULL
PRIMARY
KEY
,
b
int
unsigned
not
null
,
b
int
unsigned
not
null
,
...
@@ -99,6 +98,20 @@ CREATE TABLE t2 (
...
@@ -99,6 +98,20 @@ CREATE TABLE t2 (
UNIQUE
(
b
,
c
)
USING
HASH
UNIQUE
(
b
,
c
)
USING
HASH
)
engine
=
ndbcluster
;
)
engine
=
ndbcluster
;
insert
t2
values
(
1
,
1
,
NULL
),(
2
,
2
,
2
),(
3
,
3
,
NULL
),(
4
,
4
,
4
),(
5
,
5
,
NULL
),(
6
,
6
,
6
),(
7
,
7
,
NULL
),(
8
,
3
,
NULL
),(
9
,
3
,
NULL
);
select
*
from
t2
where
c
IS
NULL
order
by
a
;
select
*
from
t2
where
b
=
3
AND
c
IS
NULL
order
by
a
;
select
*
from
t2
where
(
b
=
3
OR
b
=
5
)
AND
c
IS
NULL
order
by
a
;
set
@
old_ecpd
=
@@
session
.
engine_condition_pushdown
;
set
engine_condition_pushdown
=
true
;
explain
select
*
from
t2
where
(
b
=
3
OR
b
=
5
)
AND
c
IS
NULL
AND
a
<
9
order
by
a
;
select
*
from
t2
where
(
b
=
3
OR
b
=
5
)
AND
c
IS
NULL
AND
a
<
9
order
by
a
;
set
engine_condition_pushdown
=
@
old_ecpd
;
drop
table
t2
;
#
#
# Show use of PRIMARY KEY USING HASH indexes
# Show use of PRIMARY KEY USING HASH indexes
#
#
...
...
mysql-test/t/ndb_update.test
View file @
9e56779f
...
@@ -23,8 +23,13 @@ UPDATE t1 set b = c;
...
@@ -23,8 +23,13 @@ UPDATE t1 set b = c;
select
*
from
t1
order
by
pk1
;
select
*
from
t1
order
by
pk1
;
UPDATE
t1
set
pk1
=
4
where
pk1
=
1
;
UPDATE
t1
set
pk1
=
4
where
pk1
=
1
;
select
*
from
t1
order
by
pk1
;
select
*
from
t1
order
by
pk1
;
--
error
1062
UPDATE
t1
set
pk1
=
4
where
pk1
=
2
;
UPDATE
IGNORE
t1
set
pk1
=
4
where
pk1
=
2
;
select
*
from
t1
order
by
pk1
;
--
error
1062
--
error
1062
UPDATE
t1
set
pk1
=
1
,
c
=
2
where
pk1
=
4
;
UPDATE
t1
set
pk1
=
1
,
c
=
2
where
pk1
=
4
;
UPDATE
IGNORE
t1
set
pk1
=
1
,
c
=
2
where
pk1
=
4
;
select
*
from
t1
order
by
pk1
;
select
*
from
t1
order
by
pk1
;
UPDATE
t1
set
pk1
=
pk1
+
10
;
UPDATE
t1
set
pk1
=
pk1
+
10
;
select
*
from
t1
order
by
pk1
;
select
*
from
t1
order
by
pk1
;
...
...
sql/ha_ndbcluster.cc
View file @
9e56779f
...
@@ -2758,6 +2758,22 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
...
@@ -2758,6 +2758,22 @@ int ha_ndbcluster::update_row(const byte *old_data, byte *new_data)
DBUG_ENTER
(
"update_row"
);
DBUG_ENTER
(
"update_row"
);
m_write_op
=
TRUE
;
m_write_op
=
TRUE
;
/*
* If IGNORE the ignore constraint violations on primary and unique keys,
* but check that it is not part of INSERT ... ON DUPLICATE KEY UPDATE
*/
if
(
m_ignore_dup_key
&&
thd
->
lex
->
sql_command
!=
SQLCOM_INSERT
)
{
int
peek_res
=
peek_indexed_rows
(
new_data
);
if
(
!
peek_res
)
{
DBUG_RETURN
(
HA_ERR_FOUND_DUPP_KEY
);
}
if
(
peek_res
!=
HA_ERR_KEY_NOT_FOUND
)
DBUG_RETURN
(
peek_res
);
}
statistic_increment
(
thd
->
status_var
.
ha_update_count
,
&
LOCK_status
);
statistic_increment
(
thd
->
status_var
.
ha_update_count
,
&
LOCK_status
);
if
(
table
->
timestamp_field_type
&
TIMESTAMP_AUTO_SET_ON_UPDATE
)
if
(
table
->
timestamp_field_type
&
TIMESTAMP_AUTO_SET_ON_UPDATE
)
{
{
...
...
storage/ndb/src/common/util/socket_io.cpp
View file @
9e56779f
...
@@ -53,10 +53,6 @@ readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis,
...
@@ -53,10 +53,6 @@ readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis,
if
(
buflen
<=
1
)
if
(
buflen
<=
1
)
return
0
;
return
0
;
int
sock_flags
=
fcntl
(
socket
,
F_GETFL
);
if
(
fcntl
(
socket
,
F_SETFL
,
sock_flags
|
O_NONBLOCK
)
==
-
1
)
return
-
1
;
fd_set
readset
;
fd_set
readset
;
FD_ZERO
(
&
readset
);
FD_ZERO
(
&
readset
);
FD_SET
(
socket
,
&
readset
);
FD_SET
(
socket
,
&
readset
);
...
@@ -76,43 +72,65 @@ readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis,
...
@@ -76,43 +72,65 @@ readln_socket(NDB_SOCKET_TYPE socket, int timeout_millis,
}
}
if
(
selectRes
==
-
1
){
if
(
selectRes
==
-
1
){
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
-
1
;
return
-
1
;
}
}
const
int
t
=
recv
(
socket
,
buf
,
buflen
,
MSG_PEEK
);
char
*
ptr
=
buf
;
int
len
=
buflen
;
do
{
int
t
;
while
((
t
=
recv
(
socket
,
ptr
,
len
,
MSG_PEEK
))
==
-
1
&&
errno
==
EINTR
);
if
(
t
<
1
)
if
(
t
<
1
)
{
{
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
-
1
;
return
-
1
;
}
}
for
(
int
i
=
0
;
i
<
t
;
i
++
)
for
(
int
i
=
0
;
i
<
t
;
i
++
)
{
if
(
ptr
[
i
]
==
'\n'
)
{
/**
* Now consume
*/
for
(
len
=
1
+
i
;
len
;
)
{
{
if
(
buf
[
i
]
==
'\n'
){
while
((
t
=
recv
(
socket
,
ptr
,
len
,
0
))
==
-
1
&&
errno
==
EINTR
);
int
r
=
recv
(
socket
,
buf
,
i
+
1
,
0
);
if
(
t
<
1
)
buf
[
i
+
1
]
=
0
;
if
(
r
<
1
)
{
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
return
-
1
;
return
-
1
;
ptr
+=
t
;
len
-=
t
;
}
ptr
[
0
]
=
0
;
return
ptr
-
buf
;
}
}
if
(
i
>
0
&&
buf
[
i
-
1
]
==
'\r'
){
buf
[
i
-
1
]
=
'\n'
;
buf
[
i
]
=
'\0'
;
}
}
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
for
(
int
tmp
=
t
;
tmp
;
)
return
r
;
{
while
((
t
=
recv
(
socket
,
ptr
,
tmp
,
0
))
==
-
1
&&
errno
==
EINTR
);
if
(
t
<
1
)
{
return
-
1
;
}
}
ptr
+=
t
;
len
-=
t
;
tmp
-=
t
;
}
}
int
r
=
recv
(
socket
,
buf
,
t
,
0
);
FD_ZERO
(
&
readset
);
if
(
r
>=
0
)
FD_SET
(
socket
,
&
readset
);
buf
[
r
]
=
0
;
timeout
.
tv_sec
=
(
timeout_millis
/
1000
);
fcntl
(
socket
,
F_SETFL
,
sock_flags
);
timeout
.
tv_usec
=
(
timeout_millis
%
1000
)
*
1000
;
return
r
;
const
int
selectRes
=
select
(
socket
+
1
,
&
readset
,
0
,
0
,
&
timeout
);
if
(
selectRes
!=
1
){
return
-
1
;
}
}
while
(
len
>
0
);
return
-
1
;
}
}
extern
"C"
extern
"C"
...
...
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