summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <kroki/tomash@moonlight.intranet>2006-07-17 15:17:18 +0400
committerunknown <kroki/tomash@moonlight.intranet>2006-07-17 15:17:18 +0400
commitec4a7522ce6b3363881b3b9b2d7140e672297347 (patch)
tree76fd8cd4b77ffe1dad6462c64414df5cb354c289
parent51dddb3ad18b78d2f5f3ca25623bfb5dc60c5341 (diff)
parentca00a985a1e3df3e2fe71e0eec125fdcfa09f1a9 (diff)
downloadmariadb-git-ec4a7522ce6b3363881b3b9b2d7140e672297347.tar.gz
Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0
into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug21013
-rw-r--r--mysql-test/r/sp.result12
-rw-r--r--mysql-test/t/sp.test27
-rw-r--r--sql/item.cc5
3 files changed, 42 insertions, 2 deletions
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 96bf2f01f86..10556bf31a2 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -5057,4 +5057,16 @@ concat('data was: /', var1, '/')
data was: /1/
drop table t3|
drop procedure bug15217|
+DROP PROCEDURE IF EXISTS bug21013 |
+CREATE PROCEDURE bug21013(IN lim INT)
+BEGIN
+DECLARE i INT DEFAULT 0;
+WHILE (i < lim) DO
+SET @b = LOCATE(_latin1'b', @a, 1);
+SET i = i + 1;
+END WHILE;
+END |
+SET @a = _latin2"aaaaaaaaaa" |
+CALL bug21013(10) |
+DROP PROCEDURE bug21013 |
drop table t1,t2;
diff --git a/mysql-test/t/sp.test b/mysql-test/t/sp.test
index 25c96042e6f..41da4eb9222 100644
--- a/mysql-test/t/sp.test
+++ b/mysql-test/t/sp.test
@@ -5962,6 +5962,33 @@ call bug15217()|
drop table t3|
drop procedure bug15217|
+
+#
+# BUG#21013: Performance Degrades when importing data that uses
+# Trigger and Stored Procedure
+#
+# This is a performance and memory leak test. Run with large number
+# passed to bug21013() procedure.
+#
+--disable_warnings
+DROP PROCEDURE IF EXISTS bug21013 |
+--enable_warnings
+
+CREATE PROCEDURE bug21013(IN lim INT)
+BEGIN
+ DECLARE i INT DEFAULT 0;
+ WHILE (i < lim) DO
+ SET @b = LOCATE(_latin1'b', @a, 1);
+ SET i = i + 1;
+ END WHILE;
+END |
+
+SET @a = _latin2"aaaaaaaaaa" |
+CALL bug21013(10) |
+
+DROP PROCEDURE bug21013 |
+
+
#
# BUG#NNNN: New bug synopsis
#
diff --git a/sql/item.cc b/sql/item.cc
index 511ea1ffb44..db8a2985cca 100644
--- a/sql/item.cc
+++ b/sql/item.cc
@@ -1418,7 +1418,8 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
In case we're in statement prepare, create conversion item
in its memory: it will be reused on each execute.
*/
- arena= thd->activate_stmt_arena_if_needed(&backup);
+ arena= thd->is_stmt_prepare() ? thd->activate_stmt_arena_if_needed(&backup)
+ : NULL;
for (i= 0, arg= args; i < nargs; i++, arg+= item_sep)
{
@@ -1453,7 +1454,7 @@ bool agg_item_charsets(DTCollation &coll, const char *fname,
been created in prepare. In this case register the change for
rollback.
*/
- if (arena && arena->is_conventional())
+ if (arena)
*arg= conv;
else
thd->change_item_tree(arg, conv);