1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

A fix and a test case for Bug#6513 "Test Suite: Values inserted by using

cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server
Crash while fetching from table with 5 million records."
A fix for a possible memory leak when fetching into an SP cursor
in a long loop.
The patch uses a common implementation of cursors in the binary protocol and 
in stored procedures and implements materialized cursors.
For implementation details, see comments in sql_cursor.cc
This commit is contained in:
konstantin@mysql.com
2005-09-22 02:11:21 +04:00
parent e89c5220b5
commit 6f8d3c4844
30 changed files with 1567 additions and 857 deletions

View File

@ -737,10 +737,12 @@ public:
void set_query_arena(Query_arena *set);
void free_items();
/* Close the active state associated with execution of this statement */
virtual void cleanup_stmt();
};
class Cursor;
class Server_side_cursor;
/*
State of a single command executed against this connection.
@ -816,7 +818,7 @@ public:
*/
char *query;
uint32 query_length; // current query length
Cursor *cursor;
Server_side_cursor *cursor;
public:
@ -833,8 +835,6 @@ public:
void restore_backup_statement(Statement *stmt, Statement *backup);
/* return class type */
virtual Type type() const;
/* Close the cursor open for this statement, if there is one */
virtual void close_cursor();
};
@ -886,9 +886,6 @@ public:
}
hash_delete(&st_hash, (byte *) statement);
}
void add_transient_cursor(Statement *stmt)
{ transient_cursor_list.append(stmt); }
void erase_transient_cursor(Statement *stmt) { stmt->unlink(); }
/*
Close all cursors of this connection that use tables of a storage
engine that has transaction-specific state and therefore can not
@ -1812,18 +1809,21 @@ public:
}
};
class select_union :public select_result_interceptor {
public:
TABLE *table;
class select_union :public select_result_interceptor
{
TMP_TABLE_PARAM tmp_table_param;
public:
TABLE *table;
select_union(TABLE *table_par);
~select_union();
select_union() :table(0) {}
int prepare(List<Item> &list, SELECT_LEX_UNIT *u);
bool send_data(List<Item> &items);
bool send_eof();
bool flush();
void set_table(TABLE *tbl) { table= tbl; }
bool create_result_table(THD *thd, List<Item> *column_types,
bool is_distinct, ulonglong options,
const char *alias);
};
/* Base subselect interface class */