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
8bb16e1e
Commit
8bb16e1e
authored
Jan 12, 2007
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge moonbone.local:/work/latest-4.1-opt-mysql
into moonbone.local:/work/latest-5.0-opt-mysql
parents
1d92b6cd
fc0e206c
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
61 additions
and
4 deletions
+61
-4
mysql-test/r/delete.result
mysql-test/r/delete.result
+8
-0
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+12
-0
mysql-test/t/delete.test
mysql-test/t/delete.test
+11
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+8
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+13
-0
sql/item_strfunc.h
sql/item_strfunc.h
+8
-3
sql/sql_delete.cc
sql/sql_delete.cc
+1
-1
No files found.
mysql-test/r/delete.result
View file @
8bb16e1e
...
...
@@ -176,6 +176,14 @@ create table t1 (a int);
delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
delete FROM `4.t1` USING t1 as `4.t1` where `4.t1`.a = 5;
drop table t1;
create table t1(f1 int primary key);
insert into t1 values (4),(3),(1),(2);
delete from t1 where (@a:= f1) order by f1 limit 1;
select @a;
@a
1
drop table t1;
End of 4.1 tests
CREATE TABLE t1 (a int not null,b int not null);
CREATE TABLE t2 (a int not null, b int not null, primary key (a,b));
CREATE TABLE t3 (a int not null, b int not null, primary key (a,b));
...
...
mysql-test/r/func_str.result
View file @
8bb16e1e
...
...
@@ -1084,6 +1084,18 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select `test`.`t1`.`s` AS `s` from `test`.`t1` where (trim(both _latin1'y' from `test`.`t1`.`s`) > _latin1'ab')
DROP TABLE t1;
create table t1(f1 varchar(4));
explain extended select encode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
Warnings:
Note 1003 select encode(test.t1.f1,'zxcv') AS `enc` from test.t1
explain extended select decode(f1,'zxcv') as 'enc' from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
Warnings:
Note 1003 select decode(test.t1.f1,'zxcv') AS `enc` from test.t1
drop table t1;
End of 4.1 tests
create table t1 (d decimal default null);
insert into t1 values (null);
...
...
mysql-test/t/delete.test
View file @
8bb16e1e
...
...
@@ -163,6 +163,17 @@ delete `4.t1` from t1 as `4.t1` where `4.t1`.a = 5;
delete
FROM
`4.t1`
USING
t1
as
`4.t1`
where
`4.t1`
.
a
=
5
;
drop
table
t1
;
#
# Bug#17711: DELETE doesn't use index when ORDER BY, LIMIT and
# non-restricting WHERE is present.
#
create
table
t1
(
f1
int
primary
key
);
insert
into
t1
values
(
4
),(
3
),(
1
),(
2
);
delete
from
t1
where
(
@
a
:=
f1
)
order
by
f1
limit
1
;
select
@
a
;
drop
table
t1
;
--
echo
End
of
4.1
tests
# End of 4.1 tests
#
...
...
mysql-test/t/func_str.test
View file @
8bb16e1e
...
...
@@ -730,6 +730,14 @@ EXPLAIN EXTENDED SELECT s FROM t1 WHERE TRIM(BOTH 'y' FROM s) > 'ab';
DROP
TABLE
t1
;
#
# Bug#23409: ENCODE() and DECODE() functions aren't printed correctly
#
create
table
t1
(
f1
varchar
(
4
));
explain
extended
select
encode
(
f1
,
'zxcv'
)
as
'enc'
from
t1
;
explain
extended
select
decode
(
f1
,
'zxcv'
)
as
'enc'
from
t1
;
drop
table
t1
;
--
echo
End
of
4.1
tests
#
...
...
sql/item_strfunc.cc
View file @
8bb16e1e
...
...
@@ -1694,6 +1694,19 @@ String *Item_func_encode::val_str(String *str)
return
res
;
}
void
Item_func_encode
::
print
(
String
*
str
)
{
str
->
append
(
func_name
());
str
->
append
(
'('
);
args
[
0
]
->
print
(
str
);
str
->
append
(
','
);
str
->
append
(
'\''
);
str
->
append
(
seed
);
str
->
append
(
'\''
);
str
->
append
(
')'
);
}
String
*
Item_func_decode
::
val_str
(
String
*
str
)
{
DBUG_ASSERT
(
fixed
==
1
);
...
...
sql/item_strfunc.h
View file @
8bb16e1e
...
...
@@ -358,19 +358,24 @@ class Item_func_encode :public Item_str_func
{
protected:
SQL_CRYPT
sql_crypt
;
String
seed
;
public:
Item_func_encode
(
Item
*
a
,
char
*
seed
)
:
Item_str_func
(
a
),
sql_crypt
(
seed
)
{}
Item_func_encode
(
Item
*
a
,
char
*
seed_arg
)
:
Item_str_func
(
a
),
sql_crypt
(
seed_arg
)
{
seed
.
copy
(
seed_arg
,
strlen
(
seed_arg
),
default_charset_info
);
}
String
*
val_str
(
String
*
);
void
fix_length_and_dec
();
const
char
*
func_name
()
const
{
return
"encode"
;
}
void
print
(
String
*
str
);
};
class
Item_func_decode
:
public
Item_func_encode
{
public:
Item_func_decode
(
Item
*
a
,
char
*
seed
)
:
Item_func_encode
(
a
,
seed
)
{}
Item_func_decode
(
Item
*
a
,
char
*
seed
_arg
)
:
Item_func_encode
(
a
,
seed_arg
)
{}
String
*
val_str
(
String
*
);
const
char
*
func_name
()
const
{
return
"decode"
;
}
};
...
...
sql/sql_delete.cc
View file @
8bb16e1e
...
...
@@ -162,7 +162,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
DBUG_RETURN
(
TRUE
);
}
if
(
!
select
&&
limit
!=
HA_POS_ERROR
)
if
(
(
!
select
||
table
->
quick_keys
.
is_clear_all
())
&&
limit
!=
HA_POS_ERROR
)
usable_index
=
get_index_for_order
(
table
,
(
ORDER
*
)(
order
->
first
),
limit
);
if
(
usable_index
==
MAX_KEY
)
...
...
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