Commit graph

396 commits

Author SHA1 Message Date
unknown
0b732c4797 Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.1
into  c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.0


include/my_sys.h:
  Auto merged
include/thr_lock.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql-common/client.c:
  Auto merged
client/mysqldump.c:
  Manual merge
include/mysql.h:
  Manual merge
libmysql/libmysql.c:
  Manual merge
myisam/rt_split.c:
  Manual merge
mysys/thr_lock.c:
  Manual merge
sql/lock.cc:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/sql_base.cc:
  Manual merge
sql/sql_table.cc:
  Manual merge
tests/mysql_client_test.c:
  Manual merge
2005-07-21 01:29:57 -04:00
unknown
ec55fec92d Implement MySQL framework to support consistent read views in
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.
2005-07-20 20:02:36 +04:00
unknown
21038e65da Merge grichter@bk-internal.mysql.com:/home/bk/mysql-4.1
into lmy002.wdf.sap.corp:/home/georg/work/mysql/prod/mysql-4.1


tests/mysql_client_test.c:
  Auto merged
2005-07-20 13:32:43 +02:00
unknown
6147be6eaf cs fixes from last commit 2005-07-20 13:31:45 +02:00
unknown
53e598665e Merge bk-internal:/home/bk/mysql-5.0
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
2005-07-19 19:59:32 -07:00
unknown
ccc3052d17 Cleanups after merge from 4.1.
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.
2005-07-19 16:32:38 -07:00
unknown
de6f5ae5ab A fix and a test case for Bug#10760 and complementary cleanups.
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''
2005-07-19 22:21:12 +04:00
unknown
e9c64ae296 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
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
2005-07-19 11:05:49 -07:00
unknown
1dccfdac1b fix for bug#12001
sql-common/client.c:
  fixed wrong offset
tests/mysql_client_test.c:
  testcase for bug #12001
2005-07-19 17:31:18 +02:00
unknown
5b6c1348c7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
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
2005-07-18 19:03:01 +03:00
unknown
96c7d12bf8 Merge rburnett@bk-internal.mysql.com:/home/bk/mysql-4.1
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
2005-07-18 08:03:59 -06:00
unknown
68b4d7b74d Cleanups during review
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()
2005-07-18 15:33:18 +03:00
unknown
0789b177e5 cs fixes 2005-07-16 09:19:23 +02:00
unknown
e54cc5b995 minor fix for restoring the previous characterset in
test_client_character_set


tests/mysql_client_test.c:
  minor fix for restoring the previous characterset.
2005-07-15 17:05:00 +02:00
unknown
6fcb9c8e80 Fix for bug #11037.
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
2005-07-15 14:30:47 +02:00
unknown
dba3190474 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-new


tests/mysql_client_test.c:
  Auto merged
2005-07-15 14:14:59 +02:00
unknown
841f71b1db Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/opt/local/work/mysql-5.0-root


libmysql/libmysql.c:
  Manual merge
tests/mysql_client_test.c:
  Manual merge
2005-07-14 20:02:34 +04:00
unknown
bd44c99b85 A fix and a test case for Bug#11183 "mysql_stmt_reset() doesn't reset
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"
2005-07-14 20:02:33 +04:00
unknown
5858a8cd42 Merge mysql.com:/opt/local/work/mysql-4.1-root
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
2005-07-14 20:02:32 +04:00
unknown
2a6e45b0b8 fix for #11808 backported.
tests/mysql_client_test.c:
  fix for #11808 backported.
  cmp_double() introduced in order to avoid using long double registers           
  (for local double vars).
2005-07-14 20:19:27 +05:00
unknown
fd9f67f8d2 Implement MarkM optimization request to avoid redundnat packet exchange
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
2005-07-14 15:27:24 +04:00
unknown
a16a61d959 A fix and a test case for Bug#9735.
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"
2005-07-14 15:13:23 +04:00
unknown
060730f40f Post-merge fixes. 2005-07-14 01:19:52 +04:00
unknown
e90a26a229 a fix (bug #11808: Test case 'mysql_client_test' fails in assert 'double_data == o_double_data')
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).
2005-07-13 11:49:54 +05:00
unknown
831e2c7f61 Bug #7142 Show Fields from fails using Borland's dbExpress interface
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
2005-07-12 08:35:30 -06:00
unknown
74e43e8c2f changes after Bar's review: renamed CHARACTER_SET to MY_CHARSET_INFO 2005-07-12 10:58:21 +02:00
unknown
c5e573dabc New attempt after Bar's review
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.
2005-07-12 10:31:43 +02:00
unknown
ad0516d91e Merge
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
2005-07-06 00:06:11 +02:00
unknown
b0a6a8e137 Makefile.am:
Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir


client/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
cmd-line-utils/libedit/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
dbug/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
extra/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
heap/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
isam/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
libmysql/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
libmysql_r/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
libmysqld/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
libmysqld/examples/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
merge/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
myisam/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
myisammrg/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
mysql-test/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
mysys/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
netware/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
regex/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
sql/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
strings/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
tests/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
vio/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
tools/Makefile.am:
  Added -I$(top_builddir)/include for searching
  generated header files, when builddir != srcdir
2005-07-05 23:24:48 +02:00
unknown
63c5a72b31 Merge mysql.com:/home/jimw/my/mysql-5.0-10214
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
2005-07-05 09:47:20 -07:00
unknown
eb4cb6eba3 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.


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.
2005-07-01 17:11:39 +04:00
unknown
d36c14f748 A fix and a test case for Bug#11172 "mysql_stmt_attr_set
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"
2005-07-01 15:47:45 +04:00
unknown
ec9ac3fe5c A fix and a test case for Bug#10794 "mysql_stmt_attr_set no
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"
2005-06-30 16:17:10 +04:00
unknown
79c1be9e44 A fix and a test case for Bug#10736 "mysql_stmt_attr_set
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"
2005-06-28 20:52:15 +04:00
unknown
86d8abdb26 Make status of NO_BACKSLASH_ESCAPES mode known to the client so
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.
2005-06-23 18:29:56 -07:00
unknown
c8c0140eec Fix a formatting bug and add a test for it.
sql/share/errmsg.txt:
  Fix a formatting bug.
sql/sql_prepare.cc:
  Fix a formatting bug.
tests/mysql_client_test.c:
  Test the server side error message.
2005-06-20 15:38:15 +04:00
unknown
c4bd17c0f0 Rewrite the test for Bug#9992. 2005-06-19 17:31:20 +04:00
unknown
0f92333d6e Fix the test for Bug#11111: coding style, a compiler warning, don't
use tabs.
2005-06-19 17:02:31 +04:00
unknown
63c21c07fc Rename all prepared statements COM_ commands to prefix with COM_STMT_
libmysql/libmysql.c:
  Rename.
libmysqld/lib_sql.cc:
  Rename.
sql/item_cmpfunc.cc:
  Use proper method to check for stmt prepare, only_prepare is removed.
sql/mysql_priv.h:
  Remove an obsolete define. Rename mysql_stmt_free to mysql_stmt_close.
sql/sql_class.h:
  Remove THD::only_prepare.
  Rename.
sql/sql_lex.cc:
  Rename COM_PREPARE -> COM_STMT_PREPARE
sql/sql_parse.cc:
  Rename.
sql/sql_prepare.cc:
  Rename.
sql/sql_yacc.yy:
  Rename.
tests/mysql_client_test.c:
  Rename.
2005-06-17 23:26:25 +04:00
unknown
4d8cbb0c27 fix of BUG#11111 fix
sql/item.h:
  revrited as recursive
sql/sql_select.cc:
  real_type is virtual
tests/mysql_client_test.c:
  check results abd delete views
2005-06-15 01:57:25 +03:00
unknown
4095a52a77 Fix 11 "fetch from view returns wrong data"
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"
2005-06-15 01:57:40 +04:00
unknown
3d43153655 WL#2286 - Compile MySQL w/YASSL support
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.
2005-06-12 18:18:46 +05:00
unknown
d0db70270c A fix and test case for Bug#10729 "mysql_stmt_attr_set
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)
2005-06-09 18:17:45 +04:00
unknown
04ed9f0204 more than 64 indexes per table. bugfixes. bug#10995 2005-06-01 18:33:16 +02:00
unknown
8264f9bd5e Fix for bug #9992: mysql_next_result hangs on error
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
2005-05-27 18:01:09 +05:00
unknown
ef342b743e Change update_auto_increment to return 1 if get_auto_increment() returned ~(ulonglong)
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
2005-05-18 10:41:35 +03:00
unknown
1c1cc00a8a Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-9643


include/mysql.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2005-05-16 18:29:04 +04:00
unknown
1bb1bc6993 A fix and a test case for Bug#9643 " CURSOR_TYPE_SCROLLABLE dos not work"
- 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.
2005-05-16 18:27:21 +04:00
unknown
70c4325d67 Fixed failing tests for not 32 bit intel machines
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
2005-05-16 13:34:23 +03:00
unknown
2a8556f32d A fix and test case for Bug#9478 "mysql_stmt_attr_set mysql_stmt_execute"
(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).
2005-05-12 11:16:12 +04:00