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
25368c35
Commit
25368c35
authored
Sep 19, 2006
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-4.1-opt
into rurik.mysql.com:/home/igor/mysql-5.0-opt
parents
cf9d1c91
294c0cca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
103 additions
and
4 deletions
+103
-4
mysql-test/r/ps.result
mysql-test/r/ps.result
+49
-2
mysql-test/t/ps.test
mysql-test/t/ps.test
+54
-2
No files found.
mysql-test/r/ps.result
View file @
25368c35
...
@@ -253,10 +253,10 @@ execute `ü` ;
...
@@ -253,10 +253,10 @@ execute `ü` ;
1234
1234
1234
1234
set names latin1;
set names latin1;
execute ``;
execute `
ü
`;
1234
1234
1234
1234
deallocate prepare ``;
deallocate prepare `
ü
`;
set names default;
set names default;
create table t1 (a varchar(10)) charset=utf8;
create table t1 (a varchar(10)) charset=utf8;
insert into t1 (a) values ('yahoo');
insert into t1 (a) values ('yahoo');
...
@@ -820,6 +820,53 @@ ERROR HY000: Variable 'max_prepared_stmt_count' is a GLOBAL variable and should
...
@@ -820,6 +820,53 @@ ERROR HY000: Variable 'max_prepared_stmt_count' is a GLOBAL variable and should
set local max_prepared_stmt_count=1;
set local max_prepared_stmt_count=1;
ERROR HY000: Variable 'max_prepared_stmt_count' is a GLOBAL variable and should be set with SET GLOBAL
ERROR HY000: Variable 'max_prepared_stmt_count' is a GLOBAL variable and should be set with SET GLOBAL
set local prepared_stmt_count=0;
set local prepared_stmt_count=0;
CREATE TABLE t1(
ID int(10) unsigned NOT NULL auto_increment,
Member_ID varchar(15) NOT NULL default '',
Action varchar(12) NOT NULL,
Action_Date datetime NOT NULL,
Track varchar(15) default NULL,
User varchar(12) default NULL,
Date_Updated timestamp NOT NULL default CURRENT_TIMESTAMP on update
CURRENT_TIMESTAMP,
PRIMARY KEY (ID),
KEY Action (Action),
KEY Action_Date (Action_Date)
);
INSERT INTO t1(Member_ID, Action, Action_Date, Track) VALUES
('111111', 'Disenrolled', '2006-03-01', 'CAD' ),
('111111', 'Enrolled', '2006-03-01', 'CAD' ),
('111111', 'Disenrolled', '2006-07-03', 'CAD' ),
('222222', 'Enrolled', '2006-03-07', 'CAD' ),
('222222', 'Enrolled', '2006-03-07', 'CHF' ),
('222222', 'Disenrolled', '2006-08-02', 'CHF' ),
('333333', 'Enrolled', '2006-03-01', 'CAD' ),
('333333', 'Disenrolled', '2006-03-01', 'CAD' ),
('444444', 'Enrolled', '2006-03-01', 'CAD' ),
('555555', 'Disenrolled', '2006-03-01', 'CAD' ),
('555555', 'Enrolled', '2006-07-21', 'CAD' ),
('555555', 'Disenrolled', '2006-03-01', 'CHF' ),
('666666', 'Enrolled', '2006-02-09', 'CAD' ),
('666666', 'Enrolled', '2006-05-12', 'CHF' ),
('666666', 'Disenrolled', '2006-06-01', 'CAD' );
PREPARE STMT FROM
"SELECT GROUP_CONCAT(Track SEPARATOR ', ') FROM t1
WHERE Member_ID=? AND Action='Enrolled' AND
(Track,Action_Date) IN (SELECT Track, MAX(Action_Date) FROM t1
WHERE Member_ID=?
GROUP BY Track
HAVING Track>='CAD' AND
MAX(Action_Date)>'2006-03-01')";
SET @id='111111';
EXECUTE STMT USING @id,@id;
GROUP_CONCAT(Track SEPARATOR ', ')
NULL
SET @id='222222';
EXECUTE STMT USING @id,@id;
GROUP_CONCAT(Track SEPARATOR ', ')
CAD
DEALLOCATE PREPARE STMT;
DROP TABLE t1;
ERROR HY000: Variable 'prepared_stmt_count' is a read only variable
ERROR HY000: Variable 'prepared_stmt_count' is a read only variable
set @@prepared_stmt_count=0;
set @@prepared_stmt_count=0;
ERROR HY000: Variable 'prepared_stmt_count' is a read only variable
ERROR HY000: Variable 'prepared_stmt_count' is a read only variable
...
...
mysql-test/t/ps.test
View file @
25368c35
...
@@ -259,8 +259,8 @@ set names utf8;
...
@@ -259,8 +259,8 @@ set names utf8;
prepare
`ü`
from
'select 1234'
;
prepare
`ü`
from
'select 1234'
;
execute
`ü`
;
execute
`ü`
;
set
names
latin1
;
set
names
latin1
;
execute
`
`
;
execute
`
ü`
;
deallocate
prepare
`
`
;
deallocate
prepare
`
ü`
;
set
names
default
;
set
names
default
;
...
@@ -563,6 +563,58 @@ set @a=200887, @b=860;
...
@@ -563,6 +563,58 @@ set @a=200887, @b=860;
# this query did not return all matching rows
# this query did not return all matching rows
execute
stmt
using
@
a
,
@
b
;
execute
stmt
using
@
a
,
@
b
;
deallocate
prepare
stmt
;
deallocate
prepare
stmt
;
#
# BUG#22085: Crash on the execution of a prepared statement that
# uses an IN subquery with aggregate functions in HAVING
#
CREATE
TABLE
t1
(
ID
int
(
10
)
unsigned
NOT
NULL
auto_increment
,
Member_ID
varchar
(
15
)
NOT
NULL
default
''
,
Action
varchar
(
12
)
NOT
NULL
,
Action_Date
datetime
NOT
NULL
,
Track
varchar
(
15
)
default
NULL
,
User
varchar
(
12
)
default
NULL
,
Date_Updated
timestamp
NOT
NULL
default
CURRENT_TIMESTAMP
on
update
CURRENT_TIMESTAMP
,
PRIMARY
KEY
(
ID
),
KEY
Action
(
Action
),
KEY
Action_Date
(
Action_Date
)
);
INSERT
INTO
t1
(
Member_ID
,
Action
,
Action_Date
,
Track
)
VALUES
(
'111111'
,
'Disenrolled'
,
'2006-03-01'
,
'CAD'
),
(
'111111'
,
'Enrolled'
,
'2006-03-01'
,
'CAD'
),
(
'111111'
,
'Disenrolled'
,
'2006-07-03'
,
'CAD'
),
(
'222222'
,
'Enrolled'
,
'2006-03-07'
,
'CAD'
),
(
'222222'
,
'Enrolled'
,
'2006-03-07'
,
'CHF'
),
(
'222222'
,
'Disenrolled'
,
'2006-08-02'
,
'CHF'
),
(
'333333'
,
'Enrolled'
,
'2006-03-01'
,
'CAD'
),
(
'333333'
,
'Disenrolled'
,
'2006-03-01'
,
'CAD'
),
(
'444444'
,
'Enrolled'
,
'2006-03-01'
,
'CAD'
),
(
'555555'
,
'Disenrolled'
,
'2006-03-01'
,
'CAD'
),
(
'555555'
,
'Enrolled'
,
'2006-07-21'
,
'CAD'
),
(
'555555'
,
'Disenrolled'
,
'2006-03-01'
,
'CHF'
),
(
'666666'
,
'Enrolled'
,
'2006-02-09'
,
'CAD'
),
(
'666666'
,
'Enrolled'
,
'2006-05-12'
,
'CHF'
),
(
'666666'
,
'Disenrolled'
,
'2006-06-01'
,
'CAD'
);
PREPARE
STMT
FROM
"SELECT GROUP_CONCAT(Track SEPARATOR ', ') FROM t1
WHERE Member_ID=? AND Action='Enrolled' AND
(Track,Action_Date) IN (SELECT Track, MAX(Action_Date) FROM t1
WHERE Member_ID=?
GROUP BY Track
HAVING Track>='CAD' AND
MAX(Action_Date)>'2006-03-01')"
;
SET
@
id
=
'111111'
;
EXECUTE
STMT
USING
@
id
,
@
id
;
SET
@
id
=
'222222'
;
EXECUTE
STMT
USING
@
id
,
@
id
;
DEALLOCATE
PREPARE
STMT
;
DROP
TABLE
t1
;
drop
table
t1
;
drop
table
t1
;
...
...
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