Commit graph

941 commits

Author SHA1 Message Date
Staale Smedseng
57ba432293 Recommit of bug 43560 after merge with mysql-5.1-bugteam 2009-05-20 16:17:47 +02:00
Bernt M. Johnsen
9ae04e6d2e Bug#23471 prepared for commit in 5.1 gca branch 2009-05-05 12:34:25 +02:00
Bernt M. Johnsen
2fd7330c2e Bug#23471 prepared for commit in 5.0 gca branch 2009-05-05 11:07:11 +02:00
Alexey Botchkov
b1444f40d5 merging 2009-04-30 12:54:45 +05:00
Alexey Botchkov
d7ad0a04d1 mysql_client_test fixed.
per-file comments:
  tests/mysql_client_test.c
the test for bug 37956 isn't relevant anymore.
The query there 'select point(?,?)' doesn't produce an error.
2009-04-30 12:52:27 +05:00
Ignacio Galarza
e82390130e auto-merge 2009-03-19 09:44:58 -04:00
Ignacio Galarza
428e28e00c auto-merge 2009-03-17 16:29:24 -04:00
Kristofer Pettersson
d6634f461b Manual merge 2009-03-06 11:49:39 +01:00
Kristofer Pettersson
76a5891429 Bug#40363 Bug 20023 is not fixed on 5.0
This is a back port from 5.1 to 5.0.

Fix for BUG 20023: mysql_change_user() resets the value
of SQL_BIG_SELECTS.
  
The bug was that SQL_BIG_SELECTS was not properly set
in COM_CHANGE_USER.
  
The fix is to update SQL_BIG_SELECTS properly.
2009-03-05 13:37:46 +01:00
Ramil Kalimullin
3a29b7afaa Auto-merge 2009-02-26 16:14:33 +04:00
Ramil Kalimullin
c8e908ffcc Fix for bug#19829:make test Failed in mysql_client_test
*with --with-charset=utf8*

Problem: wrong LONG TEXT field length is sent to a client 
when multibyte server character set used.

Fix: always limit field length sent to a client to 2^32,
as we store it in 4 byte slot.

Note: mysql_client_test changed accordingly.
2009-02-26 12:34:15 +04:00
Alexey Kopytov
57b54ae7b1 Automerge. 2009-02-19 11:56:16 +03:00
Alexey Kopytov
c4f0c2d38c Fix for bug #41078: With CURSOR_TYPE_READ_ONLY mysql_stmt_fetch()
returns short string value. 
 
Multibyte character sets were not taken into account when 
calculating max_length in Item_param::convert_str_value(). As a 
result, string parameters of a prepared statement could be 
truncated later when calculating string length in characters by 
dividing length in bytes by the charset's mbmaxlen value (e.g. in 
Field_varstring::store()). 
 
Fixed by taking charset's mbmaxlen into account when calculating 
max_length in Item_param::convert_str_value().
2009-02-19 11:49:35 +03:00
Ignacio Galarza
2d9421c3bb Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-13 11:41:47 -05:00
Ignacio Galarza
2b85c64d65 Bug#29125 Windows Server X64: so many compiler warnings
- Remove bothersome warning messages.  This change focuses on the warnings 
that are covered by the ignore file: support-files/compiler_warnings.supp.
- Strings are guaranteed to be max uint in length
2009-02-10 17:47:54 -05:00
Davi Arnaut
cf5dd72ee0 Merge from 5.0-bugteam 2009-01-15 08:28:10 -02:00
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
dfcefa2034 5.0-bugteam->5.1-bugteam merge 2008-12-11 14:49:56 +04: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
50f4e85720 5.0-bugteam->5.1-bugteam merge 2008-12-10 18:16:21 +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
95345cff20 5.0-bugteam->5.1-bugteam merge 2008-11-27 18:27:44 +04:00
Sergey Glukhov
861eeb918d removed unused variable 2008-11-27 18:26:22 +04:00
Sergey Glukhov
8a43bcc33a 5.0-bugteam->5.1-bugteam merge 2008-11-27 17:05:38 +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
Georgi Kodinov
489ad44ab5 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).
2008-10-08 14:23:53 +03:00
Sergey Glukhov
eeb35b9026 5.0-bugteam->5.1-bugteam merge 2008-08-20 16:42:01 +05: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
Sergey Glukhov
857718e28b after merge fix, related to bug#37301 changes 2008-08-20 13:15:42 +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
f4313a4d2d Merge mysql-5.0-bugteam into mysql-5.1-bugteam 2008-08-11 21:27:17 -03: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
Marc Alff
385b4bf7ff 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
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
kostja@bodhi.(none)
87a75bdf30 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.
2008-05-20 22:23:58 +04:00
kostja@bodhi.(none)
6ae3bca94e 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.
2008-05-20 20:36:26 +04:00
kostja@bodhi.(none)
7aeeb8f667 Implement some code review fixes for the fix for Bug#27430
"Crash in subquery code when in PS and table DDL changed after PREPARE"
2008-05-18 01:51:18 +04:00
kostja@dipika.(none)
d1f9376229 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.
2008-04-08 20:01:20 +04: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
davi@mysql.com/endora.local
ef728577a2 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.
2008-03-24 22:39:48 -03:00
anozdrin/alik@quad.opbmk
a40867702c Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
2008-03-18 14:13:33 +03: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
anozdrin/alik@quad.opbmk
fa6ed3cf36 Merge quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1
into  quad.opbmk:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
2008-03-18 13:51:17 +03:00
davi@buzz.(none)
b7f7c7dc35 Post-merge fixes for Bug 35103 2008-03-17 16:39:09 -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
anozdrin/alik@quad.
a590e73266 Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt
2008-03-12 15:52:38 +03:00
kaa@kaamos.(none)
28b4988ee4 Merge kaamos.(none):/data/src/opt/mysql-5.0-opt
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-03-12 13:29:50 +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)
0a7052e4d3 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt
2008-03-12 11:19:46 +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
kaa@kaamos.(none)
88a1ab6ce8 Merge kaamos.(none):/data/src/opt/bug34889/my50
into  kaamos.(none):/data/src/opt/bug34889/my51
2008-03-08 11:21:11 +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.
63902469a3 Merge quad.:/mnt/raid/alik/MySQL/devel/5.0-rt
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-build
2008-02-27 22:58:42 +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
anozdrin/alik@quad.
bdc83bf2cb Merge quad.:/mnt/raid/alik/MySQL/devel/5.1
into  quad.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged
2008-02-26 19:34:02 +03:00
kostja@dipika.(none)
d54c6a7e23 Fix the remaining memory leaks (mysql_client_test). 2008-02-26 18:07:11 +03:00
kostja@dipika.(none)
4e116fe70b Valgrind errors in mysql_client_test. 2008-02-26 17:25:21 +03:00
davi@endora.local
fd3bcbea80 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mysql.com:/Users/davi/mysql/mysql-5.1-runtime
2008-02-26 10:12:26 -03:00
kostja@dipika.(none)
34f9ead01a Merge dipika.(none):/opt/local/work/mysql-5.0-runtime
into  dipika.(none):/opt/local/work/mysql-5.1-runtime
2008-02-26 15:32:32 +03:00
kostja@dipika.(none)
74addb78e4 Fix memory leaks (valgrind) 2008-02-26 15:27:46 +03:00
kostja@dipika.(none)
461de0f35c Use an API instead of looking into stmt internals to fetch fields
(Test for Bug#32265)
2008-02-26 13:55:46 +03:00
davi@mysql.com/endora.local
bccbc79d07 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.
2008-02-25 07:48:02 -03:00
andrey@whirlpool.hristov.com
07d9c4eeb8 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.
2008-02-22 18:45:45 +01:00
davi@buzz.(none)
919ccd9111 Post-merge fixes for bugs 34587 and 32265. 2008-02-20 23:30:29 -02:00
davi@buzz.(none)
bf9142825d Merge buzz.(none):/home/davi/mysql-5.0-runtime
into  buzz.(none):/home/davi/mysql-5.1-runtime
2008-02-20 23:18:40 -02: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
guilhem@gbichot4.local
9e2b31b026 Fix for server bug experienced in Maria (wrong "Truncated incorrect <var_name>
value" error even though the value was correct): a C function in my_getopt.c
was taking bool* in parameter and was called from C++ sql_plugin.cc,
but on some Mac OS X sizeof(bool) is 1 in C and 4 in C++, giving funny
mismatches. Fixed, all other occurences of bool in C are removed, future
ones are blocked by a "C-bool-catcher" in my_global.h (use my_bool).
2008-02-18 23:29:39 +01:00
gshchepa/uchum@host.loc
32d13ab23d Bug#33699: The UPDATE statement allows NULL as new value on a NOT NULL
columns (default datatype value is assigned).

The mysql_update function has been modified to generate
an error when trying to set a NOT NULL field to NULL rather than a warning
in the set_field_to_null_with_conversions function.
2008-01-11 05:06:08 +04:00
gluh@mysql.com/eagle.(none)
3b227392c9 after merge fix 2007-12-13 16:43:38 +04:00
gluh@eagle.(none)
4f5868114a Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-12-13 15:56:04 +04:00
tnurnberg@white.intern.koehntopp.de
d3889cac7c Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/misc/mysql/31177/51-31177
2007-12-10 08:20:33 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
2959cc58cf Bug #31177: Server variables can't be set to their current values
fixes for SLES10
2007-12-10 08:12:41 +01:00
holyfoot/hf@hfmain.(none)
901dc028f9 Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/26921/my51-26921
2007-12-07 10:10:02 +04:00
holyfoot/hf@hfmain.(none)
d26de7bee0 Merge mysql.com:/home/hf/work/26921/my50-26921
into  mysql.com:/home/hf/work/26921/my51-26921
2007-12-07 09:39:31 +04: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
holyfoot/hf@hfmain.(none)
34de307073 Merge mysql.com:/home/hf/work/mrg/my50-mrg
into  mysql.com:/home/hf/work/mrg/my51-mrg
2007-12-01 00:46:44 +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)
5a6161dea4 Bug #26921 Problem in mysql_insert_id() Embedded C API function.
client library only sets mysql->insert_id when query returned
no recordset. So the embedded library should behave the same way
2007-11-30 19:16:13 +04: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
gkodinov/kgeorge@magare.gmz
b35e378f6b Merge magare.gmz:/home/kgeorge/mysql/work/B32400-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B32400-5.1-opt
2007-11-23 14:41:47 +02:00
kaa@polly.(none)
768b251a8c Merge polly.(none):/home/kaa/src/opt/bug32221/my51-bug31445
into  polly.(none):/home/kaa/src/opt/mysql-5.1-opt
2007-11-22 14:56:01 +03: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
kaa@polly.(none)
dd75ee18d4 Merge polly.(none):/home/kaa/src/opt/bug32221/my50-bug31445
into  polly.(none):/home/kaa/src/opt/bug32221/my51-bug31445
2007-11-22 14:39:07 +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
serg@janus.mylan
6f689c91d8 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-11-19 17:12:49 +01: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
gluh@eagle.(none)
58336411c9 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-11-14 17:30:16 +04:00
evgen@moonbone.local
4fa7ee92e6 Bug#30081: "ON UPDATE CURRENT_TIMESTAMP" wasn't shown by the SHOW FIELDS
command and reported to a client.

The fact that a timestamp field will be set to NO on UPDATE wasn't shown 
by the SHOW COMMAND and reported to a client through connectors. This led to
problems in the ODBC connector and might lead to a user confusion.

A new filed flag called ON_UPDATE_NOW_FLAG is added. 
Constructors of the Field_timestamp set it when a field should be set to NOW
on UPDATE.

The get_schema_column_record function now reports whether a timestamp field
will be set to NOW on UPDATE.
2007-11-13 13:24:48 +00:00
serg@janus.mylan
c38cfd0bd6 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-11-01 12:30:45 +01:00
davi@endora.local/endora
8620673f93 Post merge fix for bug 31669. 2007-10-31 13:54:53 -02:00
davi@endora.local
53a048662a Merge endora.local:/Users/davi/mysql/mysql-5.0-runtime
into  endora.local:/Users/davi/mysql/bugs/31669-5.1
2007-10-31 02:04:04 -02: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)
17acda6ca8 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-10-23 19:08:21 +05: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
serg@janus.mylan
f86510e45e Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-10-22 20:05:06 +02:00
serg@janus.mylan
6463d82d1b Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1
2007-10-19 12:44:57 +02:00
malff@lambda.hsd1.co.comcast.net.
2d6fbbda59 Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.1-rt-merge
2007-10-18 16:57:51 -06:00
serg@janus.mylan
633b6e392a tests/mysql_client_test.c: typo fixed 2007-10-16 13:20:08 +02:00
anozdrin/alik@station.
7237c31698 A patch for BUG#31418: User locks misfunctioning after
mysql_change_user().

The problem was that THD::ull was not reset in THD::cleanup().

The fix is to reset it.
2007-10-11 17:11:12 +04:00
anozdrin/alik@station.
ac83b3122c Fix for BUG#20023: mysql_change_user() resets the value
of SQL_BIG_SELECTS.

The bug was that SQL_BIG_SELECTS was not properly set
in COM_CHANGE_USER.

The fix is to update SQL_BIG_SELECTS properly.
2007-10-10 17:57:01 +04:00
gluh@eagle.(none)
16c07b16fe Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-10-04 17:13:57 +05:00
gluh@eagle.(none)
53fa81ac03 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-10-04 14:23:55 +05:00
gkodinov/kgeorge@magare.gmz
61085ae612 merge 5.0-opt -> 5.1-opt 2007-10-01 12:56:25 +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
anozdrin/alik@station.
8051b7568d Patch for BUG#30472: libmysql doesn't reset charset,
insert_id after succ. mysql_change_user() call.

See also WL 4066.
  
This bug reveals two problems:
  - the problem on the client side which was described originally;
  - the problem in protocol / the server side: connection context
    on client and server should be like after mysql_real_connect()
    and be consistent. The server however just resets character
    set variables to the global defaults.

The fix seems to be as follows:
  - extend the protocol so that the client be able to send
    character set information in COM_CHANGE_USER command;
  - change the server so that it understands client character set
    in the command;
  - change the client:
    - reset character set to the default value (which has been
      read from the configuration);
    - send character set in COM_CHANGE_USER command.
2007-09-28 23:30:54 +04:00
anozdrin/alik@station.
e452c06438 Prerequisite patch for BUG#30472: libmysql doesn't reset charset,
insert_id after succ. mysql_change_user() call.

Supply a correct packet length to dispatch command.
2007-09-28 15:42:37 +04:00
tnurnberg@sin.intern.azundris.com
f3b1822c7a Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  mysql.com:/home/tnurnberg/15327/51-15327
2007-09-15 05:12:02 +02: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@sin.intern.azundris.com
d5174aad89 Merge mysql.com:/home/tnurnberg/15327/50-15327
into  mysql.com:/home/tnurnberg/15327/51-15327
2007-09-15 04:09:38 +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
jani@a88-113-38-195.elisa-laajakaista.fi
b25dacbdee Merge a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-main
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel
2007-08-24 15:25:02 +03:00
df@pippilotta.erinye.com
6d068a5ac7 Merge dfischer@bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build
2007-08-24 10:13:03 +02:00
igor@olga.mysql.com
37f3a92a42 Post-merge fix. 2007-08-16 19:27:44 -07: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
monty@narttu.mysql.fi
9d609a59fd Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/my/mysql-5.1
2007-08-14 00:22:34 +03:00
monty@mysql.com/nosik.monty.fi
e53a73e26c Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris
Faster thr_alarm()
Added 'Opened_files' status variable to track calls to my_open()
Don't give warnings when running mysql_install_db
Added option --source-install to mysql_install_db

I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
index_read()      -> index_read_map()
index_read_idx()  -> index_read_idx_map()
index_read_last() -> index_read_last_map()
2007-08-13 16:11:25 +03:00
kostja@bodhi.(none)
b4eb961fef Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
2007-08-08 11:45:13 +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
joerg@trift2.
7ddc8c35b2 Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.1-build
into  trift2.:/MySQL/M51/push-5.1
2007-08-02 21:18:24 +02:00
joerg@trift2.
c9e9d735af Merge trift2.:/MySQL/M51/bug29982-5.1
into  trift2.:/MySQL/M51/push-5.1
2007-08-02 20:19:21 +02: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
joerg@trift2.
22d445ee70 Fix a bad BitKeeper dependency structure for the "CMakeLists.txt" files.
They had been introduced in 5.1 and were only later backported to 5.0;
as a consequence, the files in the 5.1 tree do not depend on the 5.0 ones,
and changes in 5.0 do not propagate into the 5.1 files.

To fix this, the (previous) files in 5.1 now are deleted ("bk rm"),
and the previously deleted files depending on 5.0 are now moved to the 
respective source directories ("bk mv").
The current 5.1 contents is restored in these files.

If you need the previous history of the 5.1 files ("bk revtool"),
access those in "BitKeeper/deleted".

Contrary to the original plan, I did not introduce the name
"CMakeLists.historic" - mostly in order not to clutter the source tree.

This fixes bug#29982.
2007-07-31 19:35:13 +02:00
antony@pcg5ppc.xiphis.org
e894244733 Merge pcg5ppc.xiphis.org:/private/Network/Servers/anubis.xiphis.org/home/antony/work/p2-bug25714.1.merge-5.0
into  pcg5ppc.xiphis.org:/private/Network/Servers/anubis.xiphis.org/home/antony/work/p2-bug25714.1.merge-5.1
2007-07-24 10:54:12 -07: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
1bddf38d93 build bug25714 test app on Windows 2007-07-24 09:36:56 -07:00
antony@pcg5ppc.xiphis.org
c42837a232 build bug25714 test app on Windows 2007-07-24 09:32:51 -07:00
acurtis/antony@ltamd64.xiphis.org
f736a40f82 Merge xiphis.org:/anubis/antony/work/p2-bug25714.1
into  xiphis.org:/anubis/antony/work/p2-bug25714.1.merge-5.1
2007-07-24 00:03:01 -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
gshchepa/uchum@gleb.loc
95d43074cc Merge gleb.loc:/home/uchum/work/bk/5.1
into  gleb.loc:/home/uchum/work/bk/5.1-opt
2007-07-20 04:21:46 +05:00
holyfoot/hf@mysql.com/hfmain.(none)
c4b12955b3 mysql_client_test fixed 2007-07-20 00:04:30 +05:00
holyfoot/hf@mysql.com/hfmain.(none)
d0272fe1d5 test case for memory leak added 2007-07-19 20:59:11 +05:00
dkatz@damien-katzs-computer.local
639fd4c555 Bug #29692 Single row inserts can incorrectly report a huge number of row insertions
This bug was caused by unitialized value that was the result of a bad 5.0 merge.
2007-07-16 14:53:05 -04:00
kostja@bodhi.(none)
7ce3cada45 Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
2007-07-02 01:55:01 +04:00
anozdrin/alik@ibm.
6eb17c289a Follow up to the patch for the BUG#10491. 2007-06-29 17:37:17 +04:00
kostja@bodhi.(none)
7758a5de33 Enable the disabled test case for Bug#28075 (pushbuild by now
should be fixed).
2007-06-20 19:14:59 +04:00
kostja@bodhi.(none)
72ff5488be Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
2007-06-20 19:05:38 +04:00
malff/marcsql@weblab.(none)
381deba387 Manual merge 2007-06-15 15:38:25 -06:00
malff/marcsql@weblab.(none)
e20232cf63 manual merge 2007-06-15 10:59:40 -06:00
gkodinov/kgeorge@magare.gmz
16a7a45bdc Merge magare.gmz:/home/kgeorge/mysql/work/valgrind-errs-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/valgrind-errs-5.1-opt
2007-06-14 16:52:30 +03:00
gkodinov/kgeorge@magare.gmz
78f477c9d9 corrected valgrind problems for bug 28505 and 28934 2007-06-14 15:38:52 +03:00
gkodinov/kgeorge@magare.gmz
fbefe9d552 Merge bk-internal:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/merge-5.1-opt
2007-06-12 16:34:54 +03:00
gkodinov/kgeorge@magare.gmz
2a6ac40e11 removed compilation warning 2007-06-12 14:45:30 +03:00
gkodinov/kgeorge@magare.gmz
b9876c6e9c Bug #28934: server crash when receiving malformed com_execute packets
Sometimes a parameter slot may not get a value because of the protocol
 data being plain wrong.
 Such cases should be detected and handled by returning an error.
 Fixed by checking data stream constraints where possible (like maximum
 length) and reacting to the case where a value cannot be constructed.
2007-06-12 11:02:34 +03:00
evgen@moonbone.local
a52c981d6a Merge moonbone.local:/mnt/gentoo64/work/test-5.0-opt-mysql
into  moonbone.local:/mnt/gentoo64/work/test-5.1-opt-mysql
2007-06-11 00:16:00 +04:00
evgen@moonbone.local
b90901130e Bug#28505: mysql_affected_rows() may return wrong result if CLIENT_FOUND_ROWS
flag is set.

When the CLIENT_FOUND_ROWS flag is set then the server should return
found number of rows independently whether they were updated or not.
But this wasn't the case for the INSERT statement which always returned
number of rows that were actually changed thus providing wrong info to
the user.

Now the select_insert::send_eof method and the mysql_insert function
are sending the number of touched rows if the CLIENT_FOUND_ROWS flag is set.
2007-06-07 00:30:00 +04:00
kostja@bodhi.(none)
16633169e4 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
2007-06-01 12:12:06 +04:00
malff/marcsql@weblab.(none)
e8fec66e9e Manual merge 2007-05-29 14:52:17 -06:00
thek@adventure.(none)
7fc2ddbf22 Undefined unused function causing red in PushBuild. 2007-05-29 15:05:35 +02:00
thek@adventure.(none)
343a9db45d Removed broken test from list of test to execute.
To be restored when PB is patched to ignore 
requested safemalloc memory dumps.
2007-05-29 13:37:38 +02:00
malff/marcsql@weblab.(none)
88e3abf5ef Bug#27876 (SF with cyrillic variable name fails during execution (regression))
The root cause of this bug is related to the function skip_rear_comments,
in sql_lex.cc

Recent code changes in skip_rear_comments changed the prototype from
"const uchar*" to "const char*", which had an unforseen impact on this test:
  (endp[-1] < ' ')
With unsigned characters, this code filters bytes of value [0x00 - 0x20]
With *signed* characters, this also filters bytes of value [0x80 - 0xFF].

This caused the regression reported, considering cyrillic characters in the
parameter name to be whitespace, and truncated.
Note that the regression is present both in 5.0 and 5.1.

With this fix:
- [0x80 - 0xFF] bytes are no longer considered whitespace.
This alone fixes the regression.

In addition, filtering [0x00 - 0x20] was found bogus and abusive,
so that the code now filters uses my_isspace when looking for whitespace.

Note that this fix is only addressing the regression affecting UTF-8
in general, but does not address a more fundamental problem with
skip_rear_comments: parsing a string *backwards*, starting at end[-1],
is not safe with multi-bytes characters, so that end[-1] can confuse the
last byte of a multi-byte characters with a characters to filter out.

The only known impact of this remaining issue affects objects that have to
meet all the conditions below:

- the object is a FUNCTION / PROCEDURE / TRIGGER / EVENT / VIEW
- the body consist of only *1* instruction, and does *not* contain a
  BEGIN-END block
- the instruction ends, lexically, with <ident> <whitespace>* ';'?
  For example, "select <ident>;" or "return <ident>;"
- The last character of <ident> is a multi-byte character
- the last byte of this character is ';' '*', '/' or whitespace

In this case, the body of the object will be truncated after parsing,
and stored in an invalid format.

This last issue has not been fixed in this patch, since the real fix
will be implemented by Bug 25411 (trigger code truncated), which is caused
by the very same code.
The real problem is that the function skip_rear_comments is only a
work-around, and should be removed entirely: see the proposed patch for
bug 25411 for details.
2007-05-25 14:36:01 -06:00
mleich@four.local.lan
1ce2e5c712 This changeset belongs to the fix of Bug#735 Prepared Statements: there is no support for Query Cache
- Create "--ps-protocol" and no "--<whatever>-protocol" variants of the former tests
  t/grant_cache.test and t/query_cache_sql_prepare.test.
- Some additional subtest and fixes of bugs
- Minor improvements
2007-05-24 22:13:49 +02:00
malff/marcsql@weblab.(none)
d82bed47a7 build break cleanup 2007-05-22 16:19:36 -06:00
andrey@whirlpool.mysql.com
ed4144e528 Test case for bug#28075 2007-05-22 18:18:39 +02:00
monty@mysql.com/narttu.mysql.fi
088e2395f1 WL#3817: Simplify string / memory area types and make things more consistent (first part)
The following type conversions was done:

- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t

Removed declaration of byte, gptr, my_string, my_size_t and size_s. 

Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
  instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
  as this requires fewer casts in the code and is more in line with how the
  standard functions work.
- Added extra length argument to dirname_part() to return the length of the
  created string.
- Changed (at least) following functions to take uchar* as argument:
  - db_dump()
  - my_net_write()
  - net_write_command()
  - net_store_data()
  - DBUG_DUMP()
  - decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
  argument to my_uncompress() from a pointer to a value as we only return
  one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
  the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
  casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.

Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
  needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
  explicitely as this conflict was often hided by casting the function to
  hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
  get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
  size_t. This was needed to properly detect errors (which are
  returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
  (portability fix)
- Removed windows specific code to restore cursor position as this
  causes slowdown on windows and we should not mix read() and pread()
  calls anyway as this is not thread safe. Updated function comment to
  reflect this. Changed function that depended on original behavior of
  my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
  m_size is the number of elements in the array, not a string/memory
  length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
  Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
  - Replaced some calls to alloc_root + memcpy to use
    strmake_root()/strdup_root().
  - Changed some calls from memdup() to strmake() (Safety fix)
  - Simpler loops in client-simple.c
2007-05-10 12:59:39 +03:00
holyfoot/hf@hfmain.(none)
e0b6a9baa0 Merge bk@192.168.21.1:mysql-5.1
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
2007-04-29 18:52:14 +05:00
holyfoot/hf@mysql.com/hfmain.(none)
e2f6bd86b4 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/d2/hf/mrg/mysql-5.0-opt
2007-04-29 18:42:50 +05:00
holyfoot/hf@hfmain.(none)
2fcebef31f Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
2007-04-29 13:19:32 +05:00
evgen@sunlight.local
4b5c387f5d Additional fix for the bug#27590. 2007-04-28 00:04:50 +04:00
evgen@moonbone.local
4747fa0c03 Bug#27590: Wrong DATE/DATETIME comparison.
DATE and DATETIME can be compared either as strings or as int. Both
methods have their disadvantages. Strings can contain valid DATETIME value
but have insignificant zeros omitted thus became non-comparable with
other DATETIME strings. The comparison as int usually will require conversion
from the string representation and the automatic conversion in most cases is
carried out in a wrong way thus producing wrong comparison result. Another
problem occurs when one tries to compare DATE field with a DATETIME constant.
The constant is converted to DATE losing its precision i.e. losing time part.

This fix addresses the problems described above by adding a special
DATE/DATETIME comparator. The comparator correctly converts DATE/DATETIME
string values to int when it's necessary, adds zero time part (00:00:00)
to DATE values to compare them correctly to DATETIME values. Due to correct
conversion malformed DATETIME string values are correctly compared to other
DATE/DATETIME values.

As of this patch a DATE value equals to DATETIME value with zero time part.
For example '2001-01-01' equals to '2001-01-01 00:00:00'.

The compare_datetime() function is added to the Arg_comparator class.
It implements the correct comparator for DATE/DATETIME values.
Two supplementary functions called get_date_from_str() and get_datetime_value()
are added. The first one extracts DATE/DATETIME value from a string and the
second one retrieves the correct DATE/DATETIME value from an item.
The new Arg_comparator::can_compare_as_dates() function is added and used
to check whether two given items can be compared by the compare_datetime()
comparator.
Two caching variables were added to the Arg_comparator class to speedup the
DATE/DATETIME comparison.
One more store() method was added to the Item_cache_int class to cache int
values.
The new is_datetime() function was added to the Item class. It indicates
whether the item returns a DATE/DATETIME value.
2007-04-27 00:12:09 +04:00
msvensson@pilot.blaudden
b941ef8633 Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
2007-04-23 13:28:09 +02:00
msvensson@pilot.blaudden
10181a7fa7 Fix warnings reported by icc 2007-04-23 12:02:58 +02:00
monty@mysql.com/narttu.mysql.fi
6e8b72a6bb Added more descriptive error message of why statement was automaticly dropped
Print information if net_clear() skipped bytes (As this otherwise hides critical timeing bugs)
Added DBUG_ASSERT if we get packets out of order
mysql_change_user() could on error send multiple packets, which caused mysql_client_test to randomly fail
2007-04-13 01:56:22 +03:00
gluh@mysql.com/eagle.(none)
2d47f0cb1b Bug#21432 Database/Table name limited to 64 bytes, not chars, problems with multi-byte 2007-04-03 16:13:27 +05:00
tsmith@quadxeon.mysql.com
54e7bc8daa Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/51
2007-03-22 01:04:39 +01:00
msvensson@pilot.blaudden
709f066948 Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint
2007-03-19 11:15:59 +01:00
msvensson@pilot.blaudden
e182572212 Remove test/udf_test and test/udf_test.res, since udf's are nowadays
tested by mysql-test-run.pl
2007-03-15 15:52:04 +01:00
guilhem@gbichot3.local
eaf7728d9f Fix for BUG#735 "Prepared Statements: there is no support for Query
Cache".
WL#1569 "Prepared Statements: implement support of Query Cache".
Prepared SELECTs did not look up in the query cache, and their results
were not stored in the query cache. This made them slower than
non-prepared SELECTs in some cases.
The fix is to re-use the expanded query (the prepared query where
"?" placeholders are replaced by their values, at execution time)
for searching/storing in the query cache.
It works fine for statements prepared via mysql_stmt_prepare(), which
are the most commonly used and were the scope of this bugfix and WL.
It works less fine for statements prepared via the SQL command
PREPARE...FROM, which are still not using the query cache if they
have at least one parameter (because then the expanded query contains
names of user variables, and user variables don't work with the
query cache, even in non-prepared queries).
Note that results from prepared SELECTs, which are in the binary
protocol, and results from normal SELECTs, which are in the text
protocol, ignore each other in the query cache, because a result in the
binary protocol should never be served to a SELECT expecting the text
protocol and vice-versa.
Note, after this patch, bug 25843 starts applying to query cache
("changing default database between PREPARE and EXECUTE of statement
breaks binlog"), we need to fix it.
2007-03-09 18:09:57 +01:00
monty@mysql.com/narttu.mysql.fi
f0ae3ce9b9 Fixed compiler warnings
Fixed compile-pentium64 scripts
Fixed wrong estimate of update_with_key_prefix in sql-bench
Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1
Fixed unsafe define of uint4korr()
Fixed that --extern works with mysql-test-run.pl
Small trivial cleanups
This also fixes a bug in counting number of rows that are updated when we have many simultanous queries
Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc
Split handle_one_connection() into reusable sub functions.
Split create_new_thread() into reusable sub functions.
Added thread_scheduler; Preliminary interface code for future thread_handling code.

Use 'my_thread_id' for internal thread id's
Make thr_alarm_kill() to depend on thread_id instead of thread
Make thr_abort_locks_for_thread() depend on thread_id instead of thread
In store_globals(), set my_thread_var->id to be thd->thread_id.
Use my_thread_var->id as basis for my_thread_name()
The above changes makes the connection we have between THD and threads more soft.

Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
Fixed compiler warnings
Fixed core dumps when running with --debug
Removed setting of signal masks (was never used)
Made event code call pthread_exit() (portability fix)
Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
Removed one common 'not freed memory' warning from mysqltest
Fixed a couple of usage of not initialized warnings (unlikely cases)
Suppress compiler warnings from bdb and (for the moment) warnings from ndb
2007-02-23 13:13:55 +02:00
monty@narttu.mysql.fi
8a80e36ac3 Merge mysql.com:/home/my/mysql-5.0
into  mysql.com:/home/my/mysql-5.1
Merge of 'remove compiler warnings when using -Wshadow'
2007-01-27 03:46:45 +02:00
monty@mysql.com/narttu.mysql.fi
a04157fbb3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-01-22 14:04:40 +02:00
msvensson@pilot.mysql.com
4dbfac2a5c Merge pilot.mysql.com:/home/msvensson/mysql/mysql-5.0-maint
into  pilot.mysql.com:/home/msvensson/mysql/mysql-5.1-new-maint
2007-01-19 11:12:24 +01:00
msvensson@pilot.mysql.com
2c60829f3b Bug #15518 Reusing a stmt that has failed during prepare does not clear error
- Additional patch removing check for mysql_errno on already closed
   mysql1
2007-01-19 11:07:20 +01:00
tsmith@siva.hindu.god
94f7990ef8 Merge siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/50
into  siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/51
2007-01-18 08:41:52 -07:00
msvensson@pilot.mysql.com
d18e98929c Merge 192.168.0.10:mysql/mysql-5.0-maint
into  pilot.mysql.com:/home/msvensson/mysql/mysql-5.0-maint
2007-01-17 13:57:45 +01:00
msvensson@neptunus.(none)
11ddeb693d Merge neptunus.(none):/home/msvensson/mysql/bug15518/my50-bug15518
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2007-01-16 14:13:48 +01:00
msvensson@neptunus.(none)
f507bb2cb3 Bug#15518 Reusing a stmt that has failed during prepare does not clear error
- Always reset error when calling mysql_stmt_prepare a second time
 - Set stmt->state to MYSQL_STMT_INIT_DONE before closing prepared stmt in server.
 - Add test to mysql_client_test
 - Remove mysql_stmt_close in mysqltest after each query
 - Close all open statements in mysqltest if disable_ps_protocol is called.
2007-01-16 13:39:42 +01:00
kostja@bodhi.local
bf1005a125 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime
2007-01-11 21:59:28 +03:00
malff/marcsql@weblab.(none)
0055056c91 Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-merge
2007-01-02 14:18:13 -07:00
kent@mysql.com/kent-amd64.(none)
67868597bb Many files:
Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
  Adjusted year(s) in copyright header 
  Added GPL copyright text
my_vle.h, rpl_utility.h, my_vle.c, base64-t.c, rpl_utility.cc:
  Changed copyright header formatting some
plugin_example.c, daemon_example.c:
  Added "Copyright (C) 2006 MySQL AB" to GPL header
2006-12-31 02:29:11 +01:00
kent@kent-amd64.(none)
58763e383e Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-31 01:32:21 +01:00
kent@mysql.com/kent-amd64.(none)
6523aca729 my_strtoll10-x86.s:
Corrected spelling in copyright text
Makefile.am:
  Don't update the files from BitKeeper
Many files:
  Removed "MySQL Finland AB & TCX DataKonsult AB" from copyright header
  Adjusted year(s) in copyright header 
Many files:
  Added GPL copyright text
Removed files:
  Docs/Support/colspec-fix.pl
  Docs/Support/docbook-fixup.pl
  Docs/Support/docbook-prefix.pl
  Docs/Support/docbook-split
  Docs/Support/make-docbook
  Docs/Support/make-makefile
  Docs/Support/test-make-manual
  Docs/Support/test-make-manual-de
  Docs/Support/xwf
2006-12-31 01:02:27 +01:00
kent@kent-amd64.(none)
be15e3bc15 Merge mysql.com:/home/kent/bk/main/mysql-5.0
into  mysql.com:/home/kent/bk/main/mysql-5.1
2006-12-23 20:20:40 +01:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
monty@mysql.com/narttu.mysql.fi
a6481aa4c7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2006-12-15 01:01:52 +02:00
monty@mysql.com/narttu.mysql.fi
88dd873de0 Fixed compiler warnings detected by option -Wshadow and -Wunused:
- Removed not used variables and functions
- Added #ifdef around code that is not used
- Renamed variables and functions to avoid conflicts
- Removed some not used arguments

Fixed some class/struct warnings in ndb
Added define IS_LONGDATA() to simplify code in libmysql.c

I did run gcov on the changes and added 'purecov' comments on almost all lines that was not just variable name changes
2006-12-15 00:51:37 +02:00