cursors. This should fix Bug#11813 when InnoDB part is in
(tested with a draft patch).
The idea of the patch is that if a storage engine supports
consistent read views, we open one when open a cursor,
set is as the active view when fetch from the cursor, and close
together with cursor close.
sql/examples/ha_archive.cc:
- extend handlerton with cursors methods; fix coding style
sql/examples/ha_example.cc:
- extend handlerton with cursors methods; fix coding style
sql/examples/ha_tina.cc:
- extend handlerton with cursors methods; fix coding style
sql/ha_berkeley.cc:
- extend handlerton with cursors methods
sql/ha_blackhole.cc:
- extend handlerton with cursors methods; fix coding style
sql/ha_federated.cc:
- extend handlerton with cursors methods; fix coding style
sql/ha_heap.cc:
- extend handlerton with cursors methods; fix coding style
sql/ha_innodb.cc:
- extend handlerton with cursors methods
sql/ha_myisam.cc:
- extend handlerton with cursors methods; fix coding style
sql/ha_myisammrg.cc:
- extend handlerton with cursors methods; fix coding style
sql/ha_ndbcluster.cc:
- extend handlerton with cursors methods
sql/handler.h:
- extend handlerton with cursors methods
sql/sql_select.cc:
- create a consistent read view when we open a cursor,
set it for a fetch, and free when we closing the cursor.
sql/sql_select.h:
- add Cursor::ht_info to remember read views used in a cursor.
tests/mysql_client_test.c:
Disable an assert that will be no longer valid when consistent
read views in InnoDB are used.
into mysql.com:/home/jimw/my/mysql-5.0-clean
sql/mysql_priv.h:
Auto merged
sql/mysqld.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
sql/sql_show.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
sql/item_timefunc.cc:
Auto merged
mysql-test/r/ps_1general.result:
Update results
mysql-test/r/ps_2myisam.result:
Update results
mysql-test/r/ps_3innodb.result:
Update results
mysql-test/r/ps_4heap.result:
Update results
mysql-test/r/ps_5merge.result:
Update results
mysql-test/r/ps_6bdb.result:
Update results
mysql-test/r/ps_7ndb.result:
Update results
mysql-test/r/select.result:
Update results
mysql-test/t/disabled.def:
Disable ndb_condition_pushdown test
mysql-test/t/select.test:
Fix bad merge
sql/field_conv.cc:
Update name of warning message
sql/mysqld.cc:
Set proper thd->killed
tests/mysql_client_test.c:
Update test cases, change verify_prepared_field() help function
so it is passed the filename and line from where it is called
and includes that in the error message.
The idea of the patch
is that every cursor gets its own lock id for table level locking.
Thus cursors are protected from updates performed within the same
connection. Additionally a list of transient (must be closed at
commit) cursors is maintained and all transient cursors are closed
when necessary. Lastly, this patch adds support for deadlock
timeouts to TLL locking when using cursors.
+ post-review fixes.
include/thr_lock.h:
- add a notion of lock owner to table level locking. When using
cursors, lock owner can not be identified by a thread id any more,
as we must protect cursors from updates issued within the same
connection (thread). So, each cursor has its own lock identifier to
use with table level locking.
- extend return values of thr_lock and thr_multi_lock with
THR_LOCK_TIMEOUT and THR_LOCK_DEADLOCK, since these conditions
are now possible (see comments to thr_lock.c)
mysys/thr_lock.c:
Better support for cursors:
- use THR_LOCK_OWNER * as lock identifier, not pthread_t.
- check and return an error for a trivial deadlock case, when an
update statement is issued to a table locked by a cursor which has
been previously opened in the same connection.
- add support for locking timeouts: with use of cursors, trivial
deadlocks can occur. For now the only remedy is the lock wait timeout,
which is initialized from a new global variable 'table_lock_wait_timeout'
Example of a deadlock (assuming the storage engine does not downgrade
locks):
con1: open cursor for select * from t1;
con2: open cursor for select * from t2;
con1: update t2 set id=id*2; -- blocked
con2: update t1 set id=id*2; -- deadlock
Lock timeouts are active only if a connection is using cursors.
- the check in the wait_for_lock loop has been changed from
data->cond != cond to data->cond != 0. data->cond is zeroed
in every place it's changed.
- added comments
sql/examples/ha_archive.cc:
- extend the handlerton with the info about cursor behaviour at commit.
sql/examples/ha_archive.h:
- ctor moved to .cc to make use of archive handlerton
sql/examples/ha_example.cc:
- add handlerton instance, init handler::ht with it
sql/examples/ha_example.h:
- ctor moved to .cc to make use of ha_example handlerton
sql/examples/ha_tina.cc:
- add handlerton instance, init handler::ht with it
sql/examples/ha_tina.h:
- ctor moved to .cc to make use of CSV handlerton
sql/ha_berkeley.cc:
- init handlerton::flags and handler::ht
sql/ha_berkeley.h:
- ctor moved to .cc to make use of BerkeleyDB handlerton
sql/ha_blackhole.cc:
- add handlerton instance, init handler::ht with it
sql/ha_blackhole.h:
- ctor moved to .cc to make use of blackhole handlerton
sql/ha_federated.cc:
- add handlerton instance, init handler::ht with it
sql/ha_federated.h:
- ctor moved to .cc to make use of federated handlerton
sql/ha_heap.cc:
- add handlerton instance, init handler::ht with it
sql/ha_heap.h:
- ctor moved to .cc to make use of ha_heap handlerton
sql/ha_innodb.cc:
- init handlerton::flags and handler::ht of innobase storage engine
sql/ha_innodb.h:
- ctor moved to .cc to make use of archive handlerton
sql/ha_myisam.cc:
- add handlerton instance, init handler::ht with it
sql/ha_myisam.h:
- ctor moved to .cc to make use of MyISAM handlerton
sql/ha_myisammrg.cc:
- init handler::ht in the ctor
sql/ha_myisammrg.h:
- ctor moved to .cc to make use of MyISAM MERGE handlerton
sql/ha_ndbcluster.cc:
- init handlerton::flags and handler::ht
sql/handler.cc:
- drop support for ISAM storage engine, which was removed from 5.0
- close all "transient" cursors at COMMIT/ROLLBACK. A "transient"
SQL level cursor is a cursor that uses tables that have a transaction-
specific state.
sql/handler.h:
- extend struct handlerton with flags, add handlerton *ht to every
handler instance.
sql/lock.cc:
- extend mysql_lock_tables to send error to the client if
thr_multi_lock returns a timeout or a deadlock error.
sql/mysqld.cc:
- add server option --table_lock_wait_timeout (in seconds)
sql/set_var.cc:
- add new global variable 'table_lock_wait_timeout' to specify
a wait timeout for table-level locks of MySQL (in seconds). The default
timeout is 50 seconds. The timeout is active only if the connection
has open cursors.
sql/sql_class.cc:
- implement Statement_map::close_transient_cursors
- safety suggests that we need an assert ensuring
llock_info->n_cursors is functioning properly, adjust destruction of
the Statement_map to allow such assert in THD::~THD
sql/sql_class.h:
- add support for Cursors registry to Statement map.
sql/sql_prepare.cc:
- maintain a list of cursors that must be closed at commit/rollback.
sql/sql_select.cc:
- extend class Cursor to support specific at-COMMIT/ROLLBACK behavior.
If a cursor uses tables of a storage engine that
invalidates all open tables at COMMIT/ROLLBACK, it must be closed
before COMMIT/ROLLBACK is executed.
sql/sql_select.h:
- add an own lock_id and commit/rollback status flag to class Cursor
tests/mysql_client_test.c:
A test case for Bug#10760 and complementary issues: test a simple
deadlock case too.
mysql-test/var:
New BitKeeper file ``mysql-test/var''
into mysql.com:/home/jimw/my/mysql-5.0-clean
extra/perror.c:
Auto merged
include/my_global.h:
Auto merged
mysql-test/r/ps_1general.result:
Auto merged
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
mysql-test/r/select.result:
Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
Auto merged
ndb/src/mgmsrv/main.cpp:
Auto merged
sql/des_key_file.cc:
Auto merged
sql/field_conv.cc:
Auto merged
sql/item_func.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/item_timefunc.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_select.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
mysql-test/t/select.test:
Resolve conflicts
scripts/mysqld_safe.sh:
Resolve conflict
sql/item.cc:
Resolve conflict, don't return FIELD_TYPE_BLOB since VARCHAR
can be longer in 5.0 than 4.1.
sql/log_event.cc:
Resolve conflict
sql/mysql_priv.h:
Resolve conflict
sql/mysqld.cc:
Remove incorrect fix (merge from 4.1)
sql/sql_show.cc:
Resolve conflict
into mishka.local:/home/my/mysql-5.0
client/mysqldump.c:
Auto merged
include/my_sys.h:
Auto merged
mysys/Makefile.am:
Auto merged
sql/ha_innodb.cc:
Auto merged
sql/ha_ndbcluster.cc:
Auto merged
sql/item_cmpfunc.cc:
Auto merged
sql/item_strfunc.cc:
Auto merged
sql/log.cc:
Auto merged
sql/mysqld.cc:
Auto merged
sql/opt_range.cc:
Auto merged
sql/sql_cache.cc:
Auto merged
sql/sql_parse.cc:
Auto merged
sql/sql_prepare.cc:
Auto merged
sql/sql_show.cc:
Auto merged
sql/sql_yacc.yy:
Auto merged
tests/mysql_client_test.c:
Auto merged
sql/sql_select.cc:
Auto merged
mysys/default.c:
SCCS merged
into linux.site:/home/reggie/bk/bug7142
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
sql/item.cc:
Auto merged
sql/sql_show.cc:
Auto merged
tests/mysql_client_test.c:
Auto merged
Changed defaults option --instance to --defaults-group-suffix
Changed option handling to allow --defaults-file, --defaults-extra-file and --defaults-group-suffix to be given in any order
Changed MYSQL_INSTANCE to MYSQL_GROUP_SUFFIX
mysql_print_defaults now understands --defaults-group-suffix
Remove usage of my_tempnam() (not safe function)
if( -> if ( and while( to while (
BitKeeper/deleted/.del-my_tempnam.c~a8562f15dad3012f:
Delete: mysys/my_tempnam.c
VC++Files/client/mysqlclient.dsp:
Remove not used file my_tempnam.c
VC++Files/client/mysqlclient_ia64.dsp:
Remove not used file my_tempnam.c
VC++Files/libmysql/libmysql.dsp:
Remove not used file my_tempnam.c
VC++Files/libmysql/libmysql_ia64.dsp:
Remove not used file my_tempnam.c
VC++Files/mysys/mysys.dsp:
Remove not used file my_tempnam.c
VC++Files/mysys/mysys_ia64.dsp:
Remove not used file my_tempnam.c
client/mysql.cc:
Change to use get_defaults_options()
Remove compiler warnings
client/mysqldump.c:
Indentation fixes
Use quoted table name for 'primary_key_fields'
extra/my_print_defaults.c:
Add support for --defaults-group-suffix
change to use get_default_options()
extra/replace.c:
Replace my_tempnam() with create_tmp_file() to allow us to remove my_tempnam.c
include/config-win.h:
Added DEFAULT_GROUP_SUFFIX_ENV
include/my_sys.h:
Change defaults_instance -> defaults_group_suffix
Change get_defaults_files -> get_defaults_options
libmysql/Makefile.shared:
Added DEFAULT_GROUP_SUFFIX_ENV
mysys/Makefile.am:
Added DEFAULT_GROUP_SUFFIX_ENV
Remove my_tempnam.c
mysys/default.c:
Changed --instance to --defaults-group-suffix
Changed MYSQL_INSTANCE to MYSQL_GROUP_SUFFIX and moved the name to Makefile.am
(mysys shouldn't by MySQL independent)
Changed option handling to allow --defaults-file, --defaults-extra-file and --defaults-group-suffix to be given in any order
mysys/default_modify.c:
Optimized code to use allocated space more efficently
Reduce code size
Ensure that realloc() works independent of argument size
mysys/my_bitmap.c:
Added missing return
sql/ha_innodb.cc:
Change if( -> if (
sql/ha_ndbcluster.cc:
Change while( -> while (
sql/item_cmpfunc.cc:
Break loop early (simple optimization)
sql/item_strfunc.cc:
Change if( -> if (
sql/log.cc:
Fixed comment
sql/mysqld.cc:
Change if( -> if (
sql/opt_range.cc:
while( -> while (
if( -> if (
sql/parse_file.cc:
Change if( -> if (
sql/sql_cache.cc:
while( -> while (
sql/sql_parse.cc:
Change if( -> if (
sql/sql_prepare.cc:
Added comment
sql/sql_select.cc:
while( -> while (
Removed index variable by incrementing pointer
sql/sql_show.cc:
Change if( -> if (
sql/sql_yacc.yy:
Change if( -> if (
tests/mysql_client_test.c:
Added cast to first argument to bzero()
When all rows are fetched subsequent calls to mysql_stmt_fetch return
now MYSQL_NO_DATA instead of errorcode 1.
libmysql/libmysql.c:
fix for bug#11037
tests/mysql_client_test.c:
added new testcase for bug #11037
information about error".
libmysql/libmysql.c:
Clear the last error on the statement if mysql_stmt_reset succeeded.
tests/mysql_client_test.c:
A test case for Bug#11183 "mysql_stmt_reset() doesn't reset information
about error"
into mysql.com:/opt/local/work/mysql-5.0-root
mysql-test/r/ps_2myisam.result:
Auto merged
mysql-test/r/ps_3innodb.result:
Auto merged
mysql-test/r/ps_4heap.result:
Auto merged
mysql-test/r/ps_5merge.result:
Auto merged
mysql-test/r/ps_6bdb.result:
Auto merged
mysql-test/r/ps_7ndb.result:
Auto merged
sql/field.cc:
manual merge
tests/mysql_client_test.c:
manual merge
mysql-test/r/select.result:
manual merge
mysql-test/t/select.test:
manual merge
sql/sql_select.cc:
Auto merged
sql/item_func.cc:
Auto merged
in cursors.
libmysql/libmysql.c:
- reset_stmt_handle(): don't reset the server side just because we have
an open cursor: the server will close the cursor automatically if
needed
sql/sql_prepare.cc:
- implement Prepared_statement::close_cursor,
- implicitly close an open cursor in mysql_stmt_execute instead of
issuing an error (to reduce the need to explicitly close cursors
and save network bandwidth).
- cleanup
sql/sql_select.cc:
Remove a destructor: cursor destruction can not be done by simply
calling a destructor, because of cross-references between cursor
and statement memory.
sql/sql_select.h:
- add an empty Cursor destructor
tests/mysql_client_test.c:
- remove a test for dropped functionality
No separate typecode for MEDIUMTEXT/LONGTEXT is added, as we
have no sound decision yet what typecodes and for what types are
sent by the server (aka what constitutes a distinct type in MySQL).
mysql-test/r/ps_2myisam.result:
Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_3innodb.result:
Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_4heap.result:
Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_5merge.result:
Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_6bdb.result:
Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_7ndb.result:
Test results fixed: new longtext/longblob length (2^32)
sql/field.cc:
A fix for Bug#9735 "mysql_fetch_fields() acts strange on
LONGBLOB/LONGTEXT": fix wrong initialization of field_length
in case of BLOB fields.
tests/mysql_client_test.c:
A test case for Bug#9735 "mysql_fetch_fields() acts strange on
LONGBLOB/LONGTEXT"
tests/mysql_client_test.c:
a fix (bug #11808: Test case 'mysql_client_test' fails in assert 'double_data == o_double_data')
cmp_double() introduced in order to avoid using long double registers
(for local double vars).
The problem here is that columns that have an especially long type
such as an enum type with many options would be longer than 40 chars
but the type column returned from show columns always was defined
as varchar(40).
This is fixed in 5.0 using info schema.
mysql-test/r/ps_1general.result:
update columns which will now be reported as blobs
mysql-test/r/ps_2myisam.result:
update columns which will now be reported as blobs
mysql-test/r/ps_3innodb.result:
update columns which will now be reported as blobs
mysql-test/r/ps_4heap.result:
update columns which will now be reported as blobs
mysql-test/r/ps_5merge.result:
update columns which will now be reported as blobs
sql/item.cc:
report a column as a particular blob type if it's size warrants
sql/sql_show.cc:
Add function to iterate over all the fields of a table and determine
the longest type name.
We call this function at the top of our show fields code. We pass in
either 40 or max_len whichever is longer to the ctor of
Item_empty_string.
tests/mysql_client_test.c:
update columns which will now be reported as blobs
Added api function mysql_get_character_set_info which provides
information about the current client character set.
include/mysql.h:
Added api function mysql_get_character_set_info which provides
information about the current client character set.
libmysql/libmysql.c:
Added api function mysql_get_character_set_info which provides
information about the current client character set.
libmysql/libmysql.def:
Added api function mysql_get_character_set_info which provides
information about the current client character set.
tests/mysql_client_test.c:
Added api function mysql_get_character_set_info which provides
information about the current client character set.
BitKeeper/deleted/.del-Makefile.am~6cfa0db5e7778d09:
Auto merged
BitKeeper/deleted/.del-Makefile.am~41238af048e60515:
Auto merged
mysql-test/Makefile.am:
Auto merged
netware/Makefile.am:
Auto merged
tests/Makefile.am:
Auto merged
vio/Makefile.am:
SCCS merged
into mysql.com:/home/jimw/my/mysql-5.0-clean
include/my_sys.h:
Auto merged
include/mysql_com.h:
Auto merged
libmysql/libmysql.c:
Auto merged
sql/set_var.cc:
Auto merged
sql/sql_class.cc:
Auto merged
tests/mysql_client_test.c:
Clean up merge of new tests
Add a test case for Bug#11656 "Server crash with mysql_stmt_fetch
(cursors)", the bug itself is no longer present.
tests/mysql_client_test.c:
Add a test case for Bug#11656 "Server crash with mysql_stmt_fetch
(cursors)", the bug itself is no longer present.
CURSOR_TYPE_READ_ONLY date/datetime filter server crash".
The fix adds support for Item_change_list in cursors (proper rollback
of the modified item tree).
sql/sql_class.cc:
No need to call fatal_error() twice.
sql/sql_prepare.cc:
- implement proper cleanup of the prepared statement in mysql_stmt_reset
if there is a cursor.
- take into account thd->change_list when fetching data through a
cursor.
sql/sql_select.cc:
- take into account thd->change_list when fetching data from a cursor:
grab it when we open a cursor, and rollback the changes to the parsed
tree when we close it.
sql/sql_select.h:
- Cursor::change_list added
tests/mysql_client_test.c:
- a test case for Bug#11172 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY date/datetime
filter server crash"
open cursor after mysql_stmt_execute" + post-review fixes.
The bug was caused by wrong flags in stmt->server_status on the client
side: if there was no cursor, the server didn't send server_status
flags to the client, and the old flags were used to set up the
fetch function of a statement. Consequently, stmt_read_row_from_cursor was
used when there was no cursor. The fix fixes the server to always
send server flags to the client.
include/mysql_com.h:
Update stale comments.
libmysql/libmysql.c:
Remove an extra assignment.
libmysqld/lib_sql.cc:
Update to correspond to the changed signature of send_eof
sql/protocol.cc:
Actual fix for bug#10794: create a function that writes the eof
packet to network and use it from send_fields. We need to send
a full eof packet from send_fields to inform the client about
the cursor status (that there is no cursor in this case).
sql/protocol.h:
Remove an unused parameter for send_eof.
tests/mysql_client_test.c:
A test case for Bug#10794 "mysql_stmt_attr_set no open cursor
after mysql_stmt_execute"
CURSOR_TYPE_READ_ONLY select within select".
The bug was caused by the reset of thd->mem_root to thd->main_mem_root in
Item_subselect::exec, which in turn triggered too early free_root() for
data which was needed on subsequent fetches from a cursor.
This reset also caused a memory leak in stored procedures, as
subsequent executions of instructions containing a subselect
were allocating memory in thd->main_mem_root, which is not freed
until the end of the entire SP, instead of the per-call mem_root,
which is freed in the end of execution of the instruction.
sql/item_subselect.cc:
Don't try to protect subqueries from the code that assumes that
it can reset thd->mem_root and get away with it: it's responsibility
of the caller to ensure that no assumption about the life span
of the allocated memory made by the called code is broken.
Besides, this didn't work well with cursors and stored procedures,
where the runtime memory root is not the same as &thd->main_mem_root.
sql/opt_range.cc:
In get_mm_leaf restore the original mem_root of the thd which has
been temporarily reset with the quick select mem_root earlier: if
thd->mem_root points to the QUICK...::mem_root, the memory allocated
in JOIN::exec during evaluation of a subquery gets freed too early.
tests/mysql_client_test.c:
A test case for Bug#10736 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY
select within select"
it can use it to switch to only quoting apostrophes by doubling
them when it is in effect. (Bug #10214)
include/my_sys.h:
Add new escape_quotes_for_mysql() function
include/mysql_com.h:
Add SERVER_STATUS_NO_BACKSLASH_ESCAPES
libmysql/libmysql.c:
Use SERVER_STATUS_NO_BACKSLASH_ESCAPES in server_status to determine
how mysql_real_escape_string() should do quoting.
mysys/charset.c:
Add new escape_quotes_for_mysql() function that only quotes
apostrophes by doubling them up.
sql/set_var.cc:
Set SERVER_STATUS_NO_BACKSLASH_ESCAPES when MODE_NO_BACKSLASH_ESCAPES
changes.
sql/sql_class.cc:
Set SERVER_STATUS_NO_BACKSLASH_ESCAPES when necessary on thread creation.
tests/mysql_client_test.c:
Add new test for sending NO_BACKSLASH_ESCAPES as part of server_status.
Wrong method for creating temporary field was choosen, which results in
sending int field with int header but lonlong data.
Test case is added to mysql_client_test.c because client library is required
to test the bug.
tests/mysql_client_test.c:
Test case for bug#11111 "fetch from view returns wrong data"
sql/sql_select.cc:
Fix bug #11111 "fetch from view returns wrong data"
sql/item.h:
Fix bug #11111 "fetch from view returns wrong data"
Fix for link failures on boxes with non-gnu compiler.
client/Makefile.am:
Add a dummy C++ file to client suite to make libtool use a C++ linker:
this lets client suite link when using yaSSL and a non-gcc C++ compiler.
config/ac-macros/yassl.m4:
HAVE_YASSL conditional is used to add dummy C++ file if configured with yaSSL.
tests/Makefile.am:
Add a dummy C++ file to tests to make libtool use a C++ linker:
this lets tests link when using yaSSL and a non-gcc C++ compiler.
vio/Makefile.am:
Use dummy C++ file if configured with yaSSL only.
CURSOR_TYPE_READ_ONLY". The bug was that we (me) don't perform proper
cleanups of the prepared statement when done fetching from a cursor.
Another patch.
sql/mysql_priv.h:
Rename reset_stmt_for_execute to init_stmt_before_use (to correspond to
cleanup_stmt_and_thd_after_use).
sql/sp_head.cc:
Rename.
sql/sql_prepare.cc:
Move common cleanup code to a cleanup function, call it when we close
a cursor.
sql/sql_select.cc:
Cleanup.
sql/sql_select.h:
No need for init_thd, this code has been inlined in Cursor::open.
tests/mysql_client_test.c:
Add a test case for Bug#10729 "mysql_stmt_attr_set CURSOR_TYPE_READ_ONLY"
(problem reusing a prepared statemnt if there was a cursor)
set net->no_send_error to 0 before execution of each element of
multiquery statement to provide the sending of error to client
tests/mysql_client_test.c:
Fix for bug #9992: mysql_next_result hangs on error
test case
This makes it easier to give an error in the handler if there was a problem generating an auto-increment value
mysys/thr_alarm.c:
Remove warning from valgrind
sql/item_strfunc.cc:
Fixed indentation
tests/mysql_client_test.c:
Removed compiler warning
- check on the client the unsupported feature and return
an error message if it's been requested.
Additionally added API support for STMT_ATTR_PREFETCH_ROWS.
Post-review fixes.
include/errmsg.h:
Add a new error code for "Not implemented" client-side error message.
include/mysql.h:
Add a statement attribute STMT_ATTR_PREFETCH_ROWS - unsigned long
number of rows to fetch per one COM_FETCH command, used when there
is a read-only cursor.
Note, that we don't break compatibility by adding this new member
because MYSQL_STMT is always allocated inside the client library by
mysql_stmt_init.
libmysql/errmsg.c:
Text for the error message CR_NOT_IMPLEMENTED
libmysql/libmysql.c:
Implement support for STMT_ATTR_PREFETCH_ROWS
Return an error message on attempt to set an attribute of a prepared
statement which is not implemented yet. We probably should be doing
it in the server: currently the server just ignores unknown attributes.
tests/mysql_client_test.c:
A test case for Bug#9643 "CURSOR_TYPE_SCROLLABLE dos not work"
- check that an error message is returned for CURSOR_TYPE_SCROLLABLE.
Additionally, check setting of STMT_ATTR_PREFETCH_ROWS.
Fixed bug in mysql_stmt_fetch() when retrieving rows to return
mysql-test/r/ps.result:
Fix to not get warnings if mysql_client_test.test fails
mysql-test/t/index_merge_ror.test:
Proper fix for 64 bit intel (which gives uses another, equal good index)
mysql-test/t/ps.test:
Fix to not get warnings if mysql_client_test.test fails
sql-common/client.c:
More debugging
sql/sql_prepare.cc:
Fixed bug in mysql_stmt_fetch() when retrieving rows to return
sql/sql_select.cc:
More debugging
tests/mysql_client_test.c:
More debugging
(crash on attempt to re-execute a statement with an open cursor) +
post-review fixes.
include/errmsg.h:
Add a special error message when we attempt to mysql_stmt_fetch
from a statement which has no result set.
libmysql/errmsg.c:
Error message text for CR_NO_RESULT_SET
libmysql/libmysql.c:
Move the code which frees result sets on client and closes the cursor
on server, resets long data state on client and server.
This makes one function out of two (mysql_stmt_reset and
mysql_stmt_free_result), thus aggregating all related reset work
in one place.
sql-common/client.c:
Fix one place where we flushed the pending result set of a statement,
but didn't set unbuffered_fetch_cancelled flag.
sql/share/errmsg.txt:
Fix format of ER_UNKNOWN_STMT_HANDLER error message (needs to
be fixed separately in 4.1). Add two new error messages
for the case when we fetch from when there is no cursor
and for the case when we attempt to execute a statement while there is
a cursor.
sql/sql_prepare.cc:
Return error when we fetch while there is no open cursor and
when we call execute while there is a pending cursor.
Fix mysql_stmt_reset to close the open cursor if there is any.
sql/sql_select.cc:
free_items and free_root moved to Cursor::close().
sql/sql_select.h:
A comment added.
tests/mysql_client_test.c:
A test case for Bug#9478, test the case of mysql_stmt_reset
called for client-side cached result set and for the case with open cursor.
All strcpy replaced with strmov (review request).