Commit graph

769 commits

Author SHA1 Message Date
Sergey Glukhov
f171b7c61e 5.0-bugteam->5.1-bugteam merge 2008-11-27 18:27:44 +04:00
Sergey Glukhov
3a3d3527a3 removed unused variable 2008-11-27 18:26:22 +04:00
Sergey Glukhov
910d41725d 5.0-bugteam->5.1-bugteam merge 2008-11-27 17:05:38 +04:00
Sergey Glukhov
73960af037 Bug#40365 Prepared statements may insert invalid dates.
set DATE|DATETIME value to 0 if ALLOW_INVALID_DATES sql_mode is not enabled.


sql/field.cc:
  set DATE|DATETIME value to 0 if ALLOW_INVALID_DATES sql_mode is not enabled.
tests/mysql_client_test.c:
  test case
2008-11-27 16:41:25 +04:00
Georgi Kodinov
6d54b0443a Bug #32124: crash if prepared statements refer to variables in the where clause
The code to get read the value of a system variable was extracting its value 
on PREPARE stage and was substituting the value (as a constant) into the parse tree.
Note that this must be a reversible transformation, i.e. it must be reversed before
each re-execution.
Unfortunately this cannot be reliably done using the current code, because there are
other non-reversible source tree transformations that can interfere with this
reversible transformation.
Fixed by not resolving the value at PREPARE, but at EXECUTE (as the rest of the 
functions operate). Added a cache of the value (so that it's constant throughout
the execution of the query). Note that the cache also caches NULL values.
Updated an obsolete related test suite (variables-big) and the code to test the 
result type of system variables (as per bug 74).

mysql-test/extra/rpl_tests/rpl_insert_id.test:
  Bug #32124: removed ambiguous testcase
mysql-test/r/innodb_data_home_dir_basic.result:
  Bug #32124: fixed wrong test case
mysql-test/r/innodb_flush_method_basic.result:
  Bug #32124: fixed wrong test case
mysql-test/r/ps_11bugs.result:
  Bug #32124: test case
mysql-test/r/ssl_capath_basic.result:
  Bug #32124: fixed wrong test case
mysql-test/r/ssl_cipher_basic.result:
  Bug #32124: fixed wrong test case
mysql-test/r/variables.result:
  Bug #32124: system vars are shown as such in EXPLAIN EXTENDED, not as constants.
mysql-test/suite/rpl/r/rpl_insert_id.result:
  Bug #32124: removed ambiguous testcase
mysql-test/t/ps_11bugs.test:
  Bug #32124: test case
sql/item.cc:
  Bug #32124: placed the code to convert string to longlong or double 
  to a function (so that it can be reused)
sql/item.h:
  Bug #32124: placed the code to convert string to longlong or double 
  to a function (so that it can be reused)
sql/item_func.cc:
  Bug #32124: moved the evaluation of system variables at runtime (val_xxx).
sql/item_func.h:
  Bug #32124: moved the evaluation of system variables at runtime (val_xxx).
sql/set_var.cc:
  Bug #32124: removed the code that calculated the system variable's value 
  at PREPARE
sql/set_var.h:
  Bug #32124: removed the code that calculated the system variable's value 
  at PREPARE
tests/mysql_client_test.c:
  Bug #32124 : removed the reading of the system variable, because its max
  length is depended on the system charset and client charset and can't be
  easily calculated.
2008-10-08 14:23:53 +03:00
Sergey Glukhov
fad69f17c1 5.0-bugteam->5.1-bugteam merge 2008-08-20 16:42:01 +05:00
Sergey Glukhov
de73b72954 Bug#38291 memory corruption and server crash with view/sp/function
Send_field.org_col_name has broken value on secondary execution.
It happens when result field is created from the field which belongs to view
due to forgotten assignment of some Send_field attributes. 
The fix:
set Send_field.org_col_name,org_table_name with correct value during Send_field intialization.

mysql-test/r/metadata.result:
  result fix
  The result file was changed because now forgotten attributes are properly set.
mysql-test/r/sp.result:
  test result
mysql-test/t/sp.test:
  test case
sql/item.cc:
  Send_field.org_col_name has broken value on secondary execution.
  It happens when result field is created from the field which belongs to view
  due to forgotten assignment of some Send_field attributes. 
  The fix:
  set Send_field.org_col_name,org_table_name with correct value during Send_field intialization.
tests/mysql_client_test.c:
  test case fix
  The test was changed because now forgotten attributes are properly set.
2008-08-20 14:49:28 +05:00
Sergey Glukhov
b9bfa25fb2 after merge fix, related to bug#37301 changes 2008-08-20 13:15:42 +05:00
Chad MILLER
21598ea0e6 Bug#37301 Length and Max_length differ with no obvious reason(2nd version)
Length value is the length of the field,
Max_length is the length of the field value.
So Max_length can not be more than Length.
The fix: fixed calculation of the Item_empty_string item length

(Patch applied and queued on demand of Trudy/Davi.)

sql/item.h:
  fixed calculation of the item length
sql/sql_show.cc:
  removed unnecessary code
2008-08-15 16:13:27 -04:00
Davi Arnaut
88d10290e7 Merge mysql-5.0-bugteam into mysql-5.1-bugteam 2008-08-11 21:27:17 -03:00
Davi Arnaut
1912eaacc4 Bug#38486: Crash when using cursor protocol
Post-merge fix: mysql_client_test.c is compiled by C compilers
and some C compilers don't support mixed declarations and code
and it's explicitly forbidden by ISO C90.

tests/mysql_client_test.c:
  Don't mix declarations and code.
2008-08-11 20:27:09 -03:00
Marc Alff
7f228cf20e Manual merge of mysql-5.0-bugteam -> mysql-5.1-bugteam
Note: NULL merge of sql/sql_yacc.yy, the fix for bug#38296 will be provided separately for 5.1
2008-08-11 16:44:13 -06:00
Kristofer Pettersson
75a5ecbd72 Bug#38486 Crash when using cursor protocol
Server side cursors were not initialized properly and this caused a reference to
uninitialized memory.
2008-08-11 11:40:54 +02:00
Georgi Kodinov
ed78639805 Bug #36887: Typo in mysql_client_test.c uses bind instead of my_bind
There was a typo in a error check causing wrong thing to be ckecked 
and a possible error not being caught.
Fixed by using the correct variable to test for malloc() errors. 

tests/mysql_client_test.c:
  Bug #36887: fixed a typo
2008-05-27 14:33:08 +03:00
unknown
7ce32c91ba A number of fixes after a merge from the main 5.1 tree:
the local tree contains a fix for 
Bug#32748 "Inconsistent handling of assignments to 
general_log_file/slow_query_log_file",
which changes output of a number of tests.


mysql-test/r/general_log_file_basic.result:
  Update results (Bug#32748)
mysql-test/r/log_output_basic.result:
  Update the test with results of the fix for Bug#32748
mysql-test/r/slow_query_log_file_basic.result:
  Update the test with results of the fix for Bug#32748
mysql-test/t/general_log_file_basic.test:
  Adjust to take into account the fix for Bug#32748 
  (a port from 6.0-bugteam)
mysql-test/t/log_output_basic.test:
  Adjust to take into account the fix for Bug#32748 
  (a port from 6.0-bugteam)
mysql-test/t/slow_query_log_file_basic.test:
  Adjust to take into account the fix for Bug#32748 
  (a port from 6.0-bugteam)
tests/mysql_client_test.c:
  Fix a compilation warning.
2008-05-20 22:23:58 +04:00
unknown
02c901ee5e Bug#27430 "Crash in subquery code when in PS and table DDL changed after
PREPARE", review fixes:
- make the patch follow the specification of WL#4166 and remove  
the new error that was originally introduced.
Now the client never gets an error from reprepare, unless it failed.
I.e. even if the statement at hand returns a completely different
result set, this is not considered a server error.
The C API library, that can not handle this situation, was modified to
return a client error.
Added additional test coverage.


include/errmsg.h:
  Add a new client side error: now when we automatically
  reprepare a statement, the new result set may contain a different
  number of columns.
include/mysql_com.h:
  Add a new server status to be sent to the client if the 
  number of columns in the result set is different.
libmysql/errmsg.c:
  Add a new error message.
libmysql/libmysql.c:
  Make the client library robust against a result set that
  contains a different number of columns from prepare time.
  Previously that could never happen, and we simply had an assert.
  That means in particular that all clients are advised to upgrade
  with transition to 5.1, if they are using prepared statements C API.
  Make mysql_stmt_store_result() and mysql_stmt_execute() robust against 
  "broken" statement handles (those that have an error).
sql/sql_parse.cc:
  Clear transient server status flags at start of statement more 
  systematically.
sql/share/errmsg.txt:
  Remove an error that is unused and is not part of any public release.
sql/sql_prepare.cc:
  Instead of returning an error in case the number of result set columns
  has changed, simply update the client in server status.
  That will allow modern clients automatically recover from an error.
tests/mysql_client_test.c:
  Add additional coverage to the cases when the number of result
  set columns changed as a result of reprepare.
  Cover conversion and truncation of result set columns.
2008-05-20 20:36:26 +04:00
unknown
1cf0b5cb89 Implement some code review fixes for the fix for Bug#27430
"Crash in subquery code when in PS and table DDL changed after PREPARE"


include/my_sys.h:
  Add two new flags for my_error(). These flags help parameterize
  behavoiur of my_message_sql()
sql/item.cc:
  Update comments.
  Fix a typo in Item_param::set_param_type_and_swap_value()
sql/mysqld.cc:
  Implement two additional flags for my_error():
   - if ME_NO_SP_HANDLER is specified, ignore stored procedure continue/
      exit handlers
   - if ME_NO_WARNING_FOR_ERROR is specified, do not push warning
sql/sql_base.cc:
  Update comments.
  Rename a few methods.
sql/sql_class.h:
  Update and improve comments.
sql/sql_prepare.cc:
  Update comments.
  Style changes.
sql/table.h:
  Update comments.
  Style changes.
  Rename a few methods.
tests/mysql_client_test.c:
  Zero the bind array, to follow C API requirements.
2008-05-18 01:51:18 +04:00
unknown
a63dde5a5b Tentative implementation of
WL#4165 Prepared statements: validation 
WL#4166 Prepared statements: automatic re-prepare
Fixes
Bug#27430 Crash in subquery code when in PS and table DDL changed after PREPARE
Bug#27690 Re-execution of prepared statement after table was replaced with a view crashes
Bug#27420 A combination of PS and view operations cause error + assertion on shutdown

The basic idea of the patch is to keep track of table metadata between
prepared statement prepare and execute. If some table used in the statement
has changed, the prepared statement is re-prepared before execution.

See WL#4165 and WL#4166 contents and comments in the code for details
of the implementation.


include/my_global.h:
  Remove 'register' keyword to avoid warnings when swapping large structures
  that don't fit into a register. Any modern compiler is capable of placing
  a variable in a register when that would benefit performance.
mysql-test/r/ps_1general.result:
  Update test results: since now we re-prepare automatically,
  more correct results are produced in prepare-ddl-execute scenario.
mysql-test/r/query_cache_merge.result:
  Ensure that the table definition cache is large enough for
  the test to pass in --ps-protocol
mysql-test/r/trigger.result:
  Update test results to reflect automatic statement reprepare.
mysql-test/t/disabled.def:
  Enable ps_ddl.test, which now passes.
mysql-test/t/ps_1general.test:
  Since now we re-execute prepared statements after DDL successfully,
  change the test to produce repeatable results. Remove expectancy of
  an error in one place where now we automatically reprepare the prepared
  statement.
mysql-test/t/query_cache_merge.test:
  Ensure the table definition cache is large enough for the test to pass
  in --ps-protocol
mysql-test/t/trigger.test:
  Sinc
sql/item.cc:
  Implement Item_param "copy" functionality, used at re-prepare of
  a prepared statement.
  We copy the type of the original parameter, and move the assigned value,
  if any. Sic, the value is "moved", since it can be quite big --
  e.g. in case we deal with a LONG DATA parameter.
  It's essential to move the value from the old parameter since
  at the time of re-prepare the client packet with the necessary information
  may be not available.
sql/item.h:
  Declare a new method used for reprepare.
sql/my_decimal.h:
  Implement "swap()" functionality of class my_decimal to be
  able to easily swap two decimal values.
sql/mysql_priv.h:
  Declare enum_metadata_type.
sql/mysqld.cc:
  Implement a status variable for the number of reprepared statements.
sql/sql_base.cc:
  Implement metadata version validation.
sql/share/errmsg.txt:
  Add two new error messages: ER_NEED_REPREPARE and ER_PS_REBIND.
  The first error (theoretically) never reaches the user.
  It is issued by the metadata validation framework when a metadata version
  has changed between prepare and execute. Later on it's intercepted
  and the statement is automatically re-prepared. Only if the error
  has occurred repeatedly MAX_REPREPARE_ATTEMTS (3) times do we
  return it to the user.
  
  The second error is issued when after re-prepare we discover
  that the metadata we sent over to the client using the binary
  protocol differs drammatically from the new result set metadata 
  that the reprepared statement produces (e.g. number of result
  set columns is different).
sql/sql_class.cc:
  Implement metadata version validation framework.
sql/sql_class.h:
  Declarations for metadata version validation framework.
sql/sql_parse.cc:
  Mark commands for which we must invalidate and reprepare a prepared
  statement when metadata has changed.
sql/sql_prepare.cc:
  Implement WL#4165 and WL#4166 (limited support of metadata validation
  and re-prepare).
sql/table.h:
  Implement metadata validation.
tests/mysql_client_test.c:
  Add a test case for WL#4166
2008-04-08 20:01:20 +04:00
unknown
219c7a2a47 Merge amd64.(none):/src/mysql-5.0-bugteam
into  amd64.(none):/src/bug26243/my50-bug26243


libmysql/libmysql.c:
  Auto merged
myisam/mi_open.c:
  Auto merged
sql/ha_federated.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2008-03-28 16:01:05 -04:00
unknown
a9089cf460 Bug#26243 mysql command line crash after control-c
- Backported the 5.1 DBUG to 5.0.
- Avoid memory cleanup race on Windows client for CTRL-C


client/mysql.cc:
  Bug#26243 mysql command line crash after control-c
  - On Windows, the sigint handler shouldn't call mysql_end
  because the main thread will do so automatically.
  - Remove unnecessary signal call from the sigint handler.
  - Call my_end with proper value.
dbug/dbug.c:
  Bug#26243 mysql command line crash after control-c
  - Backported the 5.1 DBUG library. The old version uses a non-thread 
  safe global variable 'static struct state *stack'.
dbug/factorial.c:
  Bug#26243 mysql command line crash after control-c
  - Backported the 5.1 DBUG library. The old version uses a non-thread 
  safe global variable 'static struct state *stack'.
dbug/user.r:
  Bug#26243 mysql command line crash after control-c
  - Backported the 5.1 DBUG library. The old version uses a non-thread 
  safe global variable 'static struct state *stack'.
include/my_dbug.h:
  Bug#26243 mysql command line crash after control-c
  - Backported the 5.1 DBUG library. The old version uses a non-thread 
  safe global variable 'static struct state *stack'.
libmysql/libmysql.c:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
myisam/mi_open.c:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/ha_federated.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/ha_innodb.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/ha_myisammrg.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/item_cmpfunc.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/mysqld.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/net_serv.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/opt_range.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/set_var.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/slave.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/sql_cache.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/sql_select.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
tests/mysql_client_test.c:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
2008-03-28 14:02:27 -04:00
unknown
33dde6ebfa Patch for bug 28386 enabled table logging for all tests in
mysql_client_test causing a severe slowdown and increase
in memory usage, especially for test cases with long queries.

The solution is to enable the general log only in tests that
actually need the general log and disable it during the
execution of all other tests.


tests/mysql_client_test.c:
  Selectively enable and disable the general log.
2008-03-24 22:39:48 -03:00
unknown
66ca07650f Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


libmysql/libmysql.c:
  Auto merged
sql-common/client.c:
  Auto merged
tests/mysql_client_test.c:
  Manually merged.
2008-03-18 14:13:33 +03:00
unknown
f77686df0d Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0
into  quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0-rt-merged


libmysql/libmysql.c:
  Auto merged
sql-common/client.c:
  Auto merged
tests/mysql_client_test.c:
  Manually merged.
2008-03-18 13:53:51 +03:00
unknown
07db330a55 Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1
into  quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


libmysql/libmysql.c:
  Auto merged
sql-common/client.c:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2008-03-18 13:51:17 +03:00
unknown
809522598a Post-merge fixes for Bug 35103
libmysql/libmysql.c:
  Manual merge
sql/sql_class.cc:
  Don't send anything back to the client if disabled.
sql/sql_prepare.cc:
  Don't send any packet back for statement close.
tests/mysql_client_test.c:
  Manual merge
2008-03-17 16:39:09 -03:00
unknown
063b504772 Bug#35103 mysql_client_test::test_bug29948 causes sporadic failures
The problem was that the COM_STMT_SEND_LONG_DATA was sending a response
packet if the prepared statement wasn't found in the server (due to
reconnection). The commands COM_STMT_SEND_LONG_DATA and COM_STMT_CLOSE
should not send any packets, even error packets should not be sent since
they are not expected by the client API.

The solution is to clear generated during the execution of the aforementioned
commands and to skip resend of prepared statement commands. Another fix is
that if the connection breaks during the send of prepared statement command,
the command is not sent again since the prepared statement is no longer in the
server.


libmysql/libmysql.c:
  The mysql handle might be reset after a reconnection.
  Pass the now used stmt argument to cli_advanced_command.
sql-common/client.c:
  Don't resend command if the connection broke and it's a prepared
  statement command. If the session is broken, prepared statements
  on the server are gone, set the error accordanly.
sql/sql_prepare.cc:
  Clear any error set during the execution of the request
  command.
tests/mysql_client_test.c:
  Fix memory leak by freeing result associated with statement.
  Remove test case for Bug 29948 because it's not reliable in
  5.0 (fixed in 5.1) due to KILL queries sending two packets for
  a thread that kills itself.
2008-03-14 17:40:12 -03:00
unknown
f20fe94b55 Bug#35103 mysql_client_test::test_bug29948 causes sporadic failures
Disable test case for bug 29948, which is causing sporadically
failures in other tests inside mysql_client_test.


tests/mysql_client_test.c:
  Disable test case.
2008-03-13 12:14:14 +03:00
unknown
b0fda34b29 Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt


tests/mysql_client_test.c:
  Manually merged.
2008-03-12 15:52:38 +03:00
unknown
9fcf16a055 Merge kaamos.(none):/data/src/opt/mysql-5.0-opt
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


tests/mysql_client_test.c:
  Manual merge.
2008-03-12 13:29:50 +03:00
unknown
615db68d85 Re-enabled the test for mysql_insert_id() after merging from main. 2008-03-12 12:13:41 +03:00
unknown
d6df18dd33 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.hpp:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/func_time.result:
  Manual merge.
mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
scripts/mysql_config.sh:
  Manual merge.
sql-common/client.c:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
2008-03-12 11:19:46 +03:00
unknown
09f8a4af63 Merge kaamos.(none):/data/src/mysql-5.0
into  kaamos.(none):/data/src/opt/mysql-5.0-opt


client/mysql.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
scripts/mysql_config.sh:
  Manual merge.
2008-03-12 10:59:15 +03:00
unknown
92e0fbbe84 Merge kaamos.(none):/data/src/opt/bug34889/my50
into  kaamos.(none):/data/src/opt/bug34889/my51


sql/sql_insert.cc:
  Null merge.
tests/mysql_client_test.c:
  Manual merge.
2008-03-08 11:21:11 +03:00
unknown
aafb492d59 Bug#35103 mysql_client_test::test_bug29948 causes sporadic failures
Disable test case for bug 29948, which is causing sporadically
failures in other tests inside mysql_client_test.


tests/mysql_client_test.c:
  Disable test case.
2008-03-06 09:16:53 -03:00
unknown
0c1dd98ec8 Fix for bug #34889: mysql_client_test::test_mysql_insert_id test fails
sporadically

Under some circumstances, the mysql_insert_id() value after SELECT ...
INSERT could return a wrong value. This could happen when the last
SELECT ... INSERT did not involve an AUTO_INCREMENT column, but the
value of mysql_insert_id() was changed by some previous statements.

Fixed by checking the value of thd->insert_id_used in
select_insert::send_eof() and returning 0 for mysql_insert_id() if it
is not set.


sql/sql_insert.cc:
  Do not return thd->last_insert_id unconditionally in
  select_insert::send_eof(). First check if thd->insert_id_used is
  non-zero, and return 0 otherwise.
tests/mysql_client_test.c:
  Added a test case for bug #34889.
2008-03-05 16:02:33 +03:00
unknown
b3cc07838d Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-build


tests/mysql_client_test.c:
  Manually merged.
2008-02-27 22:58:42 +03:00
unknown
b43f8f695c Eliminate compilation warning. 2008-02-27 22:29:58 +03:00
unknown
e78d896c3f Bug#34889 mysql_client_test::test_mysql_insert_id test fails sporadically
Disable the test case.


tests/mysql_client_test.c:
  Disable test case.
2008-02-27 13:05:46 -03:00
unknown
336f2c7e51 Merge quad.:/mnt/raid/alik/MySQL/devel/5.1
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged


client/mysqltest.c:
  Auto merged
mysql-test/r/view.result:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_connect.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/suite/rpl_ndb/t/disabled.def:
  Manually merged.
mysql-test/t/disabled.def:
  Manually merged.
2008-02-26 19:34:02 +03:00
unknown
2aa0927d9c Fix the remaining memory leaks (mysql_client_test).
tests/mysql_client_test.c:
  Fix the remaining memory leaks.
2008-02-26 18:07:11 +03:00
unknown
6b9db6d213 Valgrind errors in mysql_client_test.
tests/mysql_client_test.c:
  Fix a memory leak.
  Run the test for Bug#28386 only if logging to tables is enabled.
2008-02-26 17:25:21 +03:00
unknown
fd31753387 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime


tests/mysql_client_test.c:
  Auto merged
2008-02-26 10:12:26 -03:00
unknown
1f3c170662 Merge dipika.(none):/opt/local/work/mysql-5.0-runtime
into  dipika.(none):/opt/local/work/mysql-5.1-runtime


tests/mysql_client_test.c:
  Manual merge.
2008-02-26 15:32:32 +03:00
unknown
24039016f0 Fix memory leaks (valgrind) 2008-02-26 15:27:46 +03:00
unknown
2967e4e104 Use an API instead of looking into stmt internals to fetch fields
(Test for Bug#32265)


tests/mysql_client_test.c:
  Use an API instead of looking into stmt internals to fetch fields.
2008-02-26 13:55:46 +03:00
unknown
b2e879cbe8 Bug#28386 the general log is incomplete
The problem is that the commands COM_STMT_CLOSE, COM_STMT_RESET,
COM_STMT_SEND_LONG_DATA weren't being logged to the general log.

The solution is to log the general log the aforementioned commands.


mysql-test/t/mysql_client_test-master.opt:
  Also log to table.
sql/sql_prepare.cc:
  Log COM_STMT_CLOSE, COM_STMT_RESET and COM_STMT_SEND_LONG_DATA.
tests/mysql_client_test.c:
  Add test case for Bug#28386
2008-02-25 07:48:02 -03:00
unknown
233143fd31 Fix for Bug#29605
--local-infile=0 checks can be bypassed by sending a FETCH LOCAL FILE response
  
Add a check for CLIENT_LOCAL_FILES before sending a local file.
Beware, that all binary distributions enable sending of local files and it's up
to the programs which use libmysql to disable it, if they don't use this functionality.
Otherwise they are not safe.


client/mysqltest.c:
  Enable LOAD DATA LOCAL INFILE for the test suite, like some rpl and ndb test.
sql-common/client.c:
  Check if the client has LOAD DATA LOCAL INFILE disabled and
  don't serve such requests from the server. This is not 100% proof,
  as if the client has this enabled, in all binary builds for BC,
  the check won't work and the client can be tricked into sending a
  local file.
tests/mysql_client_test.c:
  Switch on LOCAL INFILE in client test. If one day there
  is a test which uses it, then it will work out of the box.
2008-02-22 18:45:45 +01:00
unknown
88421ee503 Post-merge fixes for bugs 34587 and 32265.
mysql-test/r/view.result:
  Drop created view.
mysql-test/t/view.test:
  Update test result.
sql/sql_cursor.cc:
  Fix compilation failure.
tests/mysql_client_test.c:
  Manual merge.
2008-02-20 23:30:29 -02:00
unknown
96b4648b01 Merge buzz.(none):/home/davi/mysql-5.0-runtime
into  buzz.(none):/home/davi/mysql-5.1-runtime


sql/sql_cursor.cc:
  Auto merged
tests/mysql_client_test.c:
  SCCS merged
2008-02-20 23:18:40 -02:00
unknown
d34f8384b3 Post-merge fix to silence a compilation warning introduced
by patch for bug 32265 .


tests/mysql_client_test.c:
  Removed unused variable.
2008-02-20 22:11:06 -03:00