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
05bdfcbc
Commit
05bdfcbc
authored
May 10, 2013
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support upsert x=x+values(x) expressions
parent
140b303a
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
110 additions
and
37 deletions
+110
-37
mysql-test/suite/tokudb/r/fast_upsert_values.result
mysql-test/suite/tokudb/r/fast_upsert_values.result
+23
-0
mysql-test/suite/tokudb/t/fast_upsert_values.test
mysql-test/suite/tokudb/t/fast_upsert_values.test
+32
-0
storage/tokudb/ha_tokudb_update.cc
storage/tokudb/ha_tokudb_update.cc
+55
-37
No files found.
mysql-test/suite/tokudb/r/fast_upsert_values.result
0 → 100644
View file @
05bdfcbc
set default_storage_engine='tokudb';
drop table if exists t;
set tokudb_disable_slow_upsert=1;
create table t (id int primary key, x int not null);
insert noar into t values (1,1);
insert noar into t values (1,1) on duplicate key update x=x+1;
select * from t;
id x
1 2
insert noar into t values (1,10) on duplicate key update x=values(x)+1;
ERROR 42000: Table 't' uses an extension that doesn't exist in this XYZ version
select * from t;
id x
1 2
insert noar into t values (1,10) on duplicate key update x=x+values(x);
select * from t;
id x
1 12
insert noar into t values (1,100) on duplicate key update x=x+values(x);
select * from t;
id x
1 112
drop table t;
mysql-test/suite/tokudb/t/fast_upsert_values.test
0 → 100644
View file @
05bdfcbc
# verify that values(x) works in update expression
source
include
/
have_tokudb
.
inc
;
set
default_storage_engine
=
'tokudb'
;
disable_warnings
;
drop
table
if
exists
t
;
enable_warnings
;
set
tokudb_disable_slow_upsert
=
1
;
create
table
t
(
id
int
primary
key
,
x
int
not
null
);
insert
noar
into
t
values
(
1
,
1
);
insert
noar
into
t
values
(
1
,
1
)
on
duplicate
key
update
x
=
x
+
1
;
select
*
from
t
;
replace_regex
/
MariaDB
/
XYZ
/
/
MySQL
/
XYZ
/
;
error
ER_UNSUPPORTED_EXTENSION
;
insert
noar
into
t
values
(
1
,
10
)
on
duplicate
key
update
x
=
values
(
x
)
+
1
;
select
*
from
t
;
insert
noar
into
t
values
(
1
,
10
)
on
duplicate
key
update
x
=
x
+
values
(
x
);
select
*
from
t
;
insert
noar
into
t
values
(
1
,
100
)
on
duplicate
key
update
x
=
x
+
values
(
x
);
select
*
from
t
;
drop
table
t
;
storage/tokudb/ha_tokudb_update.cc
View file @
05bdfcbc
This diff is collapsed.
Click to expand it.
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