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
8c57b134
Commit
8c57b134
authored
Oct 19, 2007
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into magare.gmz:/home/kgeorge/mysql/autopush/B31157-5.1-opt
parents
0b3720fa
b87f0704
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
1 deletion
+40
-1
mysql-test/r/query_cache.result
mysql-test/r/query_cache.result
+14
-0
mysql-test/t/query_cache.test
mysql-test/t/query_cache.test
+17
-0
sql/item_func.cc
sql/item_func.cc
+8
-1
sql/item_func.h
sql/item_func.h
+1
-0
No files found.
mysql-test/r/query_cache.result
View file @
8c57b134
...
@@ -1732,4 +1732,18 @@ Variable_name Value
...
@@ -1732,4 +1732,18 @@ Variable_name Value
Qcache_queries_in_cache 1
Qcache_queries_in_cache 1
drop database db2;
drop database db2;
drop database db3;
drop database db3;
CREATE TABLE t1 (a ENUM('rainbow'));
INSERT INTO t1 VALUES (),(),(),(),();
SELECT 1 FROM t1 GROUP BY (SELECT 1 FROM t1 ORDER BY AVG(LAST_INSERT_ID()));
1
1
DROP TABLE t1;
CREATE TABLE t1 (a LONGBLOB);
INSERT INTO t1 SET a = 'aaaa';
INSERT INTO t1 SET a = 'aaaa';
SELECT 1 FROM t1 GROUP BY
(SELECT LAST_INSERT_ID() FROM t1 ORDER BY MIN(a) ASC LIMIT 1);
1
1
DROP TABLE t1;
End of 5.1 tests
End of 5.1 tests
mysql-test/t/query_cache.test
View file @
8c57b134
...
@@ -1333,4 +1333,21 @@ show status like 'Qcache_queries_in_cache';
...
@@ -1333,4 +1333,21 @@ show status like 'Qcache_queries_in_cache';
drop
database
db2
;
drop
database
db2
;
drop
database
db3
;
drop
database
db3
;
#
# Bug #31157: Crash when select+order by the avg of some field within the
# group by
#
CREATE
TABLE
t1
(
a
ENUM
(
'rainbow'
));
INSERT
INTO
t1
VALUES
(),(),(),(),();
SELECT
1
FROM
t1
GROUP
BY
(
SELECT
1
FROM
t1
ORDER
BY
AVG
(
LAST_INSERT_ID
()));
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
LONGBLOB
);
INSERT
INTO
t1
SET
a
=
'aaaa'
;
INSERT
INTO
t1
SET
a
=
'aaaa'
;
SELECT
1
FROM
t1
GROUP
BY
(
SELECT
LAST_INSERT_ID
()
FROM
t1
ORDER
BY
MIN
(
a
)
ASC
LIMIT
1
);
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
sql/item_func.cc
View file @
8c57b134
...
@@ -3624,10 +3624,17 @@ longlong Item_func_last_insert_id::val_int()
...
@@ -3624,10 +3624,17 @@ longlong Item_func_last_insert_id::val_int()
thd
->
first_successful_insert_id_in_prev_stmt
=
value
;
thd
->
first_successful_insert_id_in_prev_stmt
=
value
;
return
value
;
return
value
;
}
}
thd
->
lex
->
uncacheable
(
UNCACHEABLE_SIDEEFFECT
);
return
thd
->
read_first_successful_insert_id_in_prev_stmt
();
return
thd
->
read_first_successful_insert_id_in_prev_stmt
();
}
}
bool
Item_func_last_insert_id
::
fix_fields
(
THD
*
thd
,
Item
**
ref
)
{
thd
->
lex
->
uncacheable
(
UNCACHEABLE_SIDEEFFECT
);
return
Item_int_func
::
fix_fields
(
thd
,
ref
);
}
/* This function is just used to test speed of different functions */
/* This function is just used to test speed of different functions */
longlong
Item_func_benchmark
::
val_int
()
longlong
Item_func_benchmark
::
val_int
()
...
...
sql/item_func.h
View file @
8c57b134
...
@@ -935,6 +935,7 @@ public:
...
@@ -935,6 +935,7 @@ public:
if
(
arg_count
)
if
(
arg_count
)
max_length
=
args
[
0
]
->
max_length
;
max_length
=
args
[
0
]
->
max_length
;
}
}
bool
fix_fields
(
THD
*
thd
,
Item
**
ref
);
};
};
...
...
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