Commit graph

597 commits

Author SHA1 Message Date
Davi Arnaut
918a038165 Bug#36326: nested transaction and select
The problem is that the query cache stores packets containing
the server status of the time when the cached statement was run.
This might lead to a wrong transaction status in the client side
if a statement is cached during a transaction and is later served
outside a transaction context (and vice-versa).

The solution is to take into account the transaction status when
storing in and serving from the query cache.
2009-01-13 20:07:06 -02:00
Sergey Glukhov
e419c5d349 fix for pushbuild failure on 64 linux 2008-12-11 14:37:18 +04:00
Sergey Glukhov
87ea5307d0 disable bug37956 test if geometry package is not enabled 2008-12-11 12:57:59 +04:00
Sergey Glukhov
2b64acde8b Bug#37956 memory leak and / or crash with geometry and prepared statements!
Bug#37671 crash on prepared statement + cursor + geometry + too many open files!
if mysql_execute_command() returns error then free materialized_cursor object.
is_rnd_inited is added to satisfy rnd_end() assertion
(handler may be uninitialized in some cases)
2008-12-10 18:13:11 +04:00
Sergey Glukhov
861eeb918d removed unused variable 2008-11-27 18:26:22 +04:00
Sergey Glukhov
7b488c46a0 Bug#40365 Prepared statements may insert invalid dates.
set DATE|DATETIME value to 0 if ALLOW_INVALID_DATES sql_mode is not enabled.
2008-11-27 16:41:25 +04:00
Sergey Glukhov
9bc9ddd56e 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.
2008-08-20 14:49:28 +05:00
Chad MILLER
2941024852 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.)
2008-08-15 16:13:27 -04:00
Davi Arnaut
d5620961a6 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.
2008-08-11 20:27:09 -03:00
Kristofer Pettersson
9fc39adfda 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
afcdf5ad83 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.
2008-05-27 14:33:08 +03:00
iggy@amd64.(none)
b9877b84ac Merge amd64.(none):/src/mysql-5.0-bugteam
into  amd64.(none):/src/bug26243/my50-bug26243
2008-03-28 16:01:05 -04:00
iggy@amd64.(none)
79e434bc67 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
2008-03-28 14:02:27 -04:00
anozdrin/alik@quad.opbmk
50c37672a7 Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0
into  quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0-rt-merged
2008-03-18 13:53:51 +03:00
davi@mysql.com/endora.local
f23e3fd04c 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.
2008-03-14 17:40:12 -03:00
kaa@kaamos.(none)
3bff5b59c6 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.
2008-03-13 12:14:14 +03:00
kaa@kaamos.(none)
a48f1d24ab Re-enabled the test for mysql_insert_id() after merging from main. 2008-03-12 12:13:41 +03:00
kaa@kaamos.(none)
d0eb90501d Merge kaamos.(none):/data/src/mysql-5.0
into  kaamos.(none):/data/src/opt/mysql-5.0-opt
2008-03-12 10:59:15 +03:00
davi@mysql.com/endora.local
93a0992854 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.
2008-03-06 09:16:53 -03:00
kaa@kaamos.(none)
80d89023ea 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.
2008-03-05 16:02:33 +03:00
anozdrin/alik@quad.
ee94231f82 Eliminate compilation warning. 2008-02-27 22:29:58 +03:00
davi@mysql.com/endora.local
228d350e2e Bug#34889 mysql_client_test::test_mysql_insert_id test fails sporadically
Disable the test case.
2008-02-27 13:05:46 -03:00
kostja@dipika.(none)
74addb78e4 Fix memory leaks (valgrind) 2008-02-26 15:27:46 +03:00
davi@mysql.com/endora.local
4b821c0cbd Post-merge fix to silence a compilation warning introduced
by patch for bug 32265 .
2008-02-20 22:11:06 -03:00
davi@mysql.com/endora.local
0473205592 Bug#32265 Server returns different metadata if prepared statement is used
Executing a prepared statement associated with a materialized
cursor yields to the client a metadata packet with wrong table
and database names. The problem was occurring because the server
was sending the the name of the temporary table used by the cursor
instead of the table name of the original table. The same problem
occurs when selecting from views, in which case the table name was
being sent and not the name of the view.
  
The solution is to fill the list item from the temporary table but
preserving the table and database names of the original fields. This
is achieved by tweaking the Select_materialize to accept a pointer to
the Materialized_cursor class which contains the item list to be filled.
2008-02-20 16:45:24 -03:00
holyfoot/hf@hfmain.(none)
0b3c91e1f1 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/my50-mrg
2007-12-01 13:12:31 +04:00
kaa@polly.(none)
cf39abbbd6 Merge polly.(none):/home/kaa/src/opt/bug9481/my50-bug9481
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-11-30 18:45:35 +03:00
holyfoot/hf@mysql.com/hfmain.(none)
9786ccd0a0 Bug #32624 Error with multi queries in MySQL embedded server 5.1.22.
server status wasn't properly sent to the client after the error
by the embedded server. Wasn't noticed before as one usually stopped
retrieving results after he gets an error.
2007-11-29 10:37:07 +04:00
kaa@polly.(none)
24c9d86416 5.0 version of the fix for bug #9481: mysql_insert_id() returns 0 after
insert ... select.

The 5.0 manual page for mysql_insert_id() does not mention anything
about INSERT ... SELECT, though its current behavior is incosistent
with what the manual says about the plain INSERT.

Fixed by changing the AUTO_INCREMENT and mysql_insert_id() handling
logic in INSERT ... SELECT to be consistent with the INSERT behavior,
the manual, and the changes in 5.1 introduced by WL3146:


- mysql_insert_id() now returns the first automatically generated
AUTO_INCREMENT value that was successfully inserted by INSERT ... SELECT

-  if an INSERT ... SELECT statement is executed, and no automatically
generated value is successfully inserted, mysql_insert_id() now returns
the ID of the last inserted row.
2007-11-26 18:36:05 +03:00
gkodinov/kgeorge@magare.gmz
0b40c63fd3 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B32400-5.0-opt
2007-11-23 15:30:16 +02:00
kaa@polly.(none)
01c878e283 Merge polly.(none):/home/kaa/src/opt/bug32221/my50-bug31445
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-11-22 14:53:41 +03:00
gkodinov/kgeorge@magare.gmz
846cbf3cd0 Bug #32400: Complex SELECT query returns correct result
only on some occasions

Referencing an element from the SELECT list in a WHERE 
clause is not permitted. The namespace of the WHERE
clause is the table columns only. This was not enforced
correctly when resolving outer references in sub-queries.

Fixed by not allowing references to aliases in a 
sub-query in WHERE.
2007-11-20 19:18:21 +02:00
kaa@polly.(none)
82c4059fc9 Fix for bug #32221: bug25714, mytest, mysql_client_test complaints and
crashes.

MySQL distributions contain a number of programs that are used only by
the MySQL test suite internally, i.e. they are not indended to be
invoked directly by a user. As a result, such programs are not
documented, do not have any built-in help or proper error reporting,
which may confuse users.

This patch fixes the problem with the following changes:
- mytest, libmysqltest and all references to them were removed from the
distribution since they are not used anymore
- bug25714 now displays an error message when run with incorrect
arguments or with the --help option
- mysql_client_test now does not call abort() in case of errors,
instead it does a clean exit() with a proper error status.
2007-11-19 18:59:25 +03:00
davi@moksha.com.br
26f03b0bc6 Merge moksha.local:/Users/davi/mysql/bugs/31669-5.0
into  moksha.local:/Users/davi/mysql/mysql-5.0-runtime
2007-10-30 09:41:24 -03:00
gluh@eagle.(none)
237383f0fe Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-10-23 18:51:43 +05:00
davi@moksha.local/moksha.com.br
dac55f09f0 Bug#31669 Buffer overflow in mysql_change_user()
The problem is that when copying the supplied username and
database, no bounds checking is performed on the fixed-length
buffer. A sufficiently large (> 512) user string can easily
cause stack corruption. Since this API can be used from PHP
and other programs, this is a serious problem.

The solution is to increase the buffer size to the accepted
size in similar functions and perform bounds checking when
copying the username and database.
2007-10-23 09:05:39 -03:00
evgen@moonbone.local
77dabba63f Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/27990-bug-5.0-opt-mysql
2007-09-28 23:27:23 +00:00
evgen@moonbone.local
b9e81c2ae3 Bug#27990: Wrong info in MYSQL_FIELD struct members when a tmp table was used.
The change_to_use_tmp_fields function leaves the orig_table member of an
expression's tmp table field filled for the new Item_field being created.
Later orig_table is used by the Field::make_field function to provide some
info about original table and field name to a user. This is ok for a field
but for an expression it should be empty.

The change_to_use_tmp_fields function now resets orig_table member of
an expression's tmp table field to prevent providing a wrong info to a user.
The Field::make_field function now resets the table_name and the org_col_name
variables when the orig_table is set to 0.
2007-09-28 23:24:40 +00:00
tnurnberg@sin.intern.azundris.com
7451aaf48c Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/tnurnberg/15327/50-15327
2007-09-15 04:45:20 +02:00
tnurnberg@mysql.com/sin.intern.azundris.com
3c6ca8d6ed Bug #15327: configure: --with-tcp-port option being partially ignored
make sure that if builder configured with a non-standard (!= 3306)
default TCP port that value actually gets used throughout. if they
didn't configure a value, assume "use a sensible default", which
will be read from /etc/services or, failing that, from the factory
default. That makes the order of preference
- command-line option
- my.cnf, where applicable
- $MYSQL_TCP_PORT environment variable
- /etc/services (unless configured --with-tcp-port)
- default port (--with-tcp-port=... or factory default)
2007-09-13 16:19:46 +02:00
evgen@moonbone.local
222fddcb79 mysql_client_test.c:
Post fix for the bug#29948.
2007-08-15 18:21:58 +04:00
evgen@moonbone.local
1cc8f0e383 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29948-bug-5.0-opt-mysql
2007-08-14 18:16:34 +04:00
evgen@moonbone.local
4bc4d834fd Bug#29948: Unchecked NULL pointer caused server crash.
The cli_read_binary_rows function is used to fetch data from the server
after a prepared statement execution. It accepts a statement handler and gets
the connection handler from it. But when the auto-reconnect option is set
the connection handler is reset to NULL after reconnection because the
prepared statement is lost and the handler became useless. This case
wasn't checked in the cli_read_binary_rows function and caused server crash.

Now the cli_read_binary_rows function checks the connection handler to be
not NULL and returns an error if it is.
2007-08-14 17:28:51 +04:00
kostja@bodhi.(none)
3c6eb0002d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
2007-08-08 11:34:35 +04:00
kostja@bodhi.(none)
ec5464d2e0 A fix and a test case for Bug#29306 "Truncated data in MS Access with decimal (3,1) columns in a
VIEW".

mysql_list_fields() C API function would incorrectly set MYSQL_FIELD::decimals
member for some view columns.

The problem was in an incomplete implementation of 
Item_ident_for_show::make_field(), which is responsible for view
columns metadata.
2007-08-06 14:22:24 +04:00
kent@kent-amd64.(none)
b976f18c1b Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0-build
into  mysql.com:/home/kent/bk/cmake-tls/mysql-5.0-build
2007-08-02 15:39:34 +02:00
kent@mysql.com/kent-amd64.(none)
74267ad9b8 CMakeLists.txt (several), make_win_bin_dist:
Aligned client library build and use with the Unix version when it
  comes to what source to include directly in the builds, and what
  libraries to link with (bug#30118).

  Also reviewed, corrected and made more clear when static or dynamic
  Thread Local Storage is to be used. Some code duplication was removed,
  and some redundant library usage were removed, reducing the risk of
  incorrect TLS usage.
2007-08-02 12:49:27 +02:00
antony@pcg5ppc.xiphis.org
3f06084e7f fix compile on Windows for bug25714.c
---
fix compile on Windows for bug25714.c
2007-07-24 10:50:28 -07:00
antony@pcg5ppc.xiphis.org
c42837a232 build bug25714 test app on Windows 2007-07-24 09:32:51 -07:00
antony@pcg5ppc.xiphis.org
6b38c5b762 Bug#25714
"getGeneratedKeys() does not work with FEDERATED table"
  mysql_insert() expected the storage engine to update the row data
  during the write_row() operation with the value of the new auto-
  increment field. The field must be updated when only one row has
  been inserted as mysql_insert() would ignore the thd->last_insert.
  This patch implements HA_STATUS_AUTO support in ha_federated::info()
  and ensures that ha_federated::write_row() does update the row's
  auto-increment value.
  The test case was written in C as the protocol's 'id' value is
  accessible through libmysqlclient and not via SQL statements.
  mysql-test-run.pl was extended to enable running the test binary.
2007-07-23 23:35:43 -07:00