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
cfa509ac
Commit
cfa509ac
authored
Jun 24, 2003
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-4.0
into deer.(none):/home/hf/work/mysql-4.0.666
parents
3d5f6a88
8bed69fa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
12 deletions
+46
-12
mysql-test/r/func_str.result
mysql-test/r/func_str.result
+13
-0
mysql-test/t/func_str.test
mysql-test/t/func_str.test
+12
-0
sql/item_strfunc.cc
sql/item_strfunc.cc
+21
-12
No files found.
mysql-test/r/func_str.result
View file @
cfa509ac
...
@@ -234,3 +234,16 @@ INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
...
@@ -234,3 +234,16 @@ INSERT INTO t1 VALUES (1, 'a545f661efdd1fb66fdee3aab79945bf');
SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password");
SELECT 1 FROM t1 WHERE tmp=AES_DECRYPT(tmp,"password");
1
1
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (
wid int(10) unsigned NOT NULL auto_increment,
data_podp date default NULL,
status_wnio enum('nowy','podp','real','arch') NOT NULL default 'nowy',
PRIMARY KEY(wid),
);
INSERT INTO t1 VALUES (8,NULL,'real');
INSERT INTO t1 VALUES (9,NULL,'nowy');
SELECT elt(status_wnio,data_podp) FROM t1 GROUP BY wid;
elt(status_wnio,data_podp)
NULL
NULL
DROP TABLE t1;
mysql-test/t/func_str.test
View file @
cfa509ac
...
@@ -125,3 +125,15 @@ CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (
...
@@ -125,3 +125,15 @@ CREATE TABLE t1 (id int(11) NOT NULL auto_increment, tmp text NOT NULL, KEY id (
INSERT
INTO
t1
VALUES
(
1
,
'a545f661efdd1fb66fdee3aab79945bf'
);
INSERT
INTO
t1
VALUES
(
1
,
'a545f661efdd1fb66fdee3aab79945bf'
);
SELECT
1
FROM
t1
WHERE
tmp
=
AES_DECRYPT
(
tmp
,
"password"
);
SELECT
1
FROM
t1
WHERE
tmp
=
AES_DECRYPT
(
tmp
,
"password"
);
DROP
TABLE
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
wid
int
(
10
)
unsigned
NOT
NULL
auto_increment
,
data_podp
date
default
NULL
,
status_wnio
enum
(
'nowy'
,
'podp'
,
'real'
,
'arch'
)
NOT
NULL
default
'nowy'
,
PRIMARY
KEY
(
wid
),
);
INSERT
INTO
t1
VALUES
(
8
,
NULL
,
'real'
);
INSERT
INTO
t1
VALUES
(
9
,
NULL
,
'nowy'
);
SELECT
elt
(
status_wnio
,
data_podp
)
FROM
t1
GROUP
BY
wid
;
DROP
TABLE
t1
;
sql/item_strfunc.cc
View file @
cfa509ac
...
@@ -1539,37 +1539,46 @@ void Item_func_elt::update_used_tables()
...
@@ -1539,37 +1539,46 @@ void Item_func_elt::update_used_tables()
double
Item_func_elt
::
val
()
double
Item_func_elt
::
val
()
{
{
uint
tmp
;
uint
tmp
;
if
((
tmp
=
(
uint
)
item
->
val_int
())
==
0
||
tmp
>
arg_count
)
{
null_value
=
1
;
null_value
=
1
;
if
((
tmp
=
(
uint
)
item
->
val_int
())
==
0
||
tmp
>
arg_count
)
return
0.0
;
return
0.0
;
}
double
result
=
args
[
tmp
-
1
]
->
val
();
if
(
args
[
tmp
-
1
]
->
is_null
())
return
0.0
;
null_value
=
0
;
null_value
=
0
;
return
args
[
tmp
-
1
]
->
val
()
;
return
result
;
}
}
longlong
Item_func_elt
::
val_int
()
longlong
Item_func_elt
::
val_int
()
{
{
uint
tmp
;
uint
tmp
;
if
((
tmp
=
(
uint
)
item
->
val_int
())
==
0
||
tmp
>
arg_count
)
{
null_value
=
1
;
null_value
=
1
;
if
((
tmp
=
(
uint
)
item
->
val_int
())
==
0
||
tmp
>
arg_count
)
return
0
;
return
0
;
}
int
result
=
args
[
tmp
-
1
]
->
val_int
();
if
(
args
[
tmp
-
1
]
->
is_null
())
return
0
;
null_value
=
0
;
null_value
=
0
;
return
args
[
tmp
-
1
]
->
val_int
()
;
return
result
;
}
}
String
*
Item_func_elt
::
val_str
(
String
*
str
)
String
*
Item_func_elt
::
val_str
(
String
*
str
)
{
{
uint
tmp
;
uint
tmp
;
if
((
tmp
=
(
uint
)
item
->
val_int
())
==
0
||
tmp
>
arg_count
)
{
null_value
=
1
;
null_value
=
1
;
if
((
tmp
=
(
uint
)
item
->
val_int
())
==
0
||
tmp
>
arg_count
)
return
NULL
;
return
NULL
;
}
String
*
result
=
args
[
tmp
-
1
]
->
val_str
(
str
);
if
(
args
[
tmp
-
1
]
->
is_null
())
return
NULL
;
null_value
=
0
;
null_value
=
0
;
return
args
[
tmp
-
1
]
->
val_str
(
str
)
;
return
result
;
}
}
...
...
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