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
8e4fca2a
Commit
8e4fca2a
authored
Feb 04, 2005
by
pekka@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
b823638f
9eacf61d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
9 deletions
+51
-9
mysql-test/r/update.result
mysql-test/r/update.result
+7
-0
mysql-test/t/update.test
mysql-test/t/update.test
+9
-0
ndb/src/common/util/NdbSqlUtil.cpp
ndb/src/common/util/NdbSqlUtil.cpp
+33
-3
sql/item_func.cc
sql/item_func.cc
+2
-6
No files found.
mysql-test/r/update.result
View file @
8e4fca2a
...
@@ -212,3 +212,10 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
...
@@ -212,3 +212,10 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1";
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
update t1 left join t2 on t1.c1 = t2.c1 set t2.c2 = "t2c2-1" where t1.c3 = 10;
drop table t1, t2;
drop table t1, t2;
create table t1 (id int not null auto_increment primary key, id_str varchar(32));
insert into t1 (id_str) values ("test");
update t1 set id_str = concat(id_str, id) where id = last_insert_id();
select * from t1;
id id_str
1 test1
drop table t1;
mysql-test/t/update.test
View file @
8e4fca2a
...
@@ -170,3 +170,12 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
...
@@ -170,3 +170,12 @@ insert into t1 values (1, "t1c2-1", 10), (2, "t1c2-2", 20);
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
;
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
;
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
where
t1
.
c3
=
10
;
update
t1
left
join
t2
on
t1
.
c1
=
t2
.
c1
set
t2
.
c2
=
"t2c2-1"
where
t1
.
c3
=
10
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# Bug #8057
#
create
table
t1
(
id
int
not
null
auto_increment
primary
key
,
id_str
varchar
(
32
));
insert
into
t1
(
id_str
)
values
(
"test"
);
update
t1
set
id_str
=
concat
(
id_str
,
id
)
where
id
=
last_insert_id
();
select
*
from
t1
;
drop
table
t1
;
ndb/src/common/util/NdbSqlUtil.cpp
View file @
8e4fca2a
...
@@ -550,8 +550,6 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
...
@@ -550,8 +550,6 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
return
+
1
;
return
+
1
;
return
0
;
return
0
;
}
}
assert
(
!
full
);
return
CmpUnknown
;
#else
#else
char
t1
[
4
],
t2
[
4
];
char
t1
[
4
],
t2
[
4
];
if
(
n1
==
3
&&
n2
==
3
)
if
(
n1
==
3
&&
n2
==
3
)
...
@@ -562,6 +560,7 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
...
@@ -562,6 +560,7 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
p2
=
t2
;
p2
=
t2
;
n1
=
n2
=
4
;
n1
=
n2
=
4
;
}
}
#ifdef ndb_date_sol9x86_cc_xO3_madness
if
(
n2
>=
4
)
{
// may access 4-th byte
if
(
n2
>=
4
)
{
// may access 4-th byte
const
uchar
*
v1
=
(
const
uchar
*
)
p1
;
const
uchar
*
v1
=
(
const
uchar
*
)
p1
;
const
uchar
*
v2
=
(
const
uchar
*
)
p2
;
const
uchar
*
v2
=
(
const
uchar
*
)
p2
;
...
@@ -576,9 +575,40 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
...
@@ -576,9 +575,40 @@ NdbSqlUtil::cmpDate(const void* info, const void* p1, unsigned n1, const void* p
return
+
1
;
return
+
1
;
return
0
;
return
0
;
}
}
#else
if
(
n2
>=
4
)
{
const
uchar
*
v1
=
(
const
uchar
*
)
p1
;
const
uchar
*
v2
=
(
const
uchar
*
)
p2
;
uint
j1
=
uint3korr
(
v1
);
uint
j2
=
uint3korr
(
v2
);
uint
d1
=
(
j1
&
31
);
uint
d2
=
(
j2
&
31
);
j1
=
(
j1
>>
5
);
j2
=
(
j2
>>
5
);
uint
m1
=
(
j1
&
15
);
uint
m2
=
(
j2
&
15
);
j1
=
(
j1
>>
4
);
j2
=
(
j2
>>
4
);
uint
y1
=
j1
;
uint
y2
=
j2
;
if
(
y1
<
y2
)
return
-
1
;
if
(
y1
>
y2
)
return
+
1
;
if
(
m1
<
m2
)
return
-
1
;
if
(
m1
>
m2
)
return
+
1
;
if
(
d1
<
d2
)
return
-
1
;
if
(
d1
>
d2
)
return
+
1
;
return
0
;
}
#endif
#endif
assert
(
!
full
);
assert
(
!
full
);
return
CmpUnknown
;
return
CmpUnknown
;
#endif
}
}
// not supported
// not supported
...
...
sql/item_func.cc
View file @
8e4fca2a
...
@@ -2383,14 +2383,10 @@ longlong Item_func_last_insert_id::val_int()
...
@@ -2383,14 +2383,10 @@ longlong Item_func_last_insert_id::val_int()
longlong
value
=
args
[
0
]
->
val_int
();
longlong
value
=
args
[
0
]
->
val_int
();
current_thd
->
insert_id
(
value
);
current_thd
->
insert_id
(
value
);
null_value
=
args
[
0
]
->
null_value
;
null_value
=
args
[
0
]
->
null_value
;
return
value
;
}
}
else
else
{
current_thd
->
lex
->
uncacheable
(
UNCACHEABLE_SIDEEFFECT
);
Item
*
it
=
get_system_var
(
current_thd
,
OPT_SESSION
,
"last_insert_id"
,
14
,
return
current_thd
->
insert_id
();
"last_insert_id()"
);
return
it
->
val_int
();
}
}
}
/* This function is just used to test speed of different functions */
/* This function is just used to test speed of different functions */
...
...
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