Commit graph

195 commits

Author SHA1 Message Date
monty@mysql.com
6fbc869d18 A lot of fixes for prepared statements (PS):
New mysqltest that can run mysqltest with PS
Added support for ZEROFILL in PS
Fixed crash when one called mysql_stmt_store_result() without a preceding mysql_stmt_bind_result()
Updated test cases to support --ps-protocol
(Some tests are still run using old protocol)
Fixed crash in PS when using SELECT * FROM t1 NATURAL JOIN t2...
Fixed crash in PS when using sub queries
Create table didn't signal when table was created. This could cause a "DROP TABLE created_table" in another thread to wait "forever"
Fixed wrong permissions check in PS and multi-table updates (one could get permission denied for legal quries)
Fix for PS and SELECT ... PROCEDURE
Reset all warnings when executing a new PS query
group_concat(...ORDER BY) didn't work with PS
Fixed problem with test suite when not using innodb
2004-10-26 19:30:01 +03:00
monty@mysql.com
3afecef4df Fix compiler warnings (detected by Intel's C++ compiler)
Fixed checking of privilege handling in CREATE ... SELECT (Bug #6094)
2004-10-22 18:44:51 +03:00
konstantin@mysql.com
a55e6dda22 Manual merge. 2004-10-21 18:44:40 +04:00
konstantin@mysql.com
49a58fc64e A fix and test case for bug#6059 "mysql_stmt_field_count returns
positive numbers when no resultset is available": when sending
result set metadata we need to use virtual select_result::send_fields, 
and not address protocol directly, because select_result descendents may 
intercept result set (it's the case for example for SELECT INTO OUTFILE).
2004-10-21 18:33:53 +04:00
dlenev@mysql.com
a10ce662b4 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-secfix
2004-10-20 17:02:15 +04:00
dlenev@brandersnatch.localdomain
75d816627c Fix for bug #6173 "One can circumvent missing UPDATE privilege if
he has SELECT and INSERT privileges for table with primary key"

Now we set lex->duplicates= DUP_UPDATE right in parser if INSERT has
ON DUPLICATE KEY UPDATE clause, this simplifies insert_precheck()
function (this also fixes a bug) and some other code.
2004-10-20 16:04:43 +04:00
monty@mishka.local
57a85986ac Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mishka.local:/home/my/mysql-4.1
2004-10-14 18:06:38 +03:00
monty@mishka.local
719c88e38f true,false -> TRUE, FALSE
Simple fixes/optimization of things discovered during review of new pushed code
2004-10-14 18:03:46 +03:00
konstantin@mysql.com
5abc3de22b A fix and test case for Bug#5985 ""prepare stmt from "select rand(?)"
crashes server." The fix makes Item_func_rand prepared-statements
aware plus it fixes the case when RAND is used in prepared
statements and replication is on (as well as several similar issues).
Until now we did not reset THD before every execution of a prepared
statement, so if some execution had set thd->time_zone_used
or thd->rand_used they would not be reset until next mysql_parse.
Some of post-review fixes done.
2004-10-14 02:53:59 +04:00
konstantin@mysql.com
2aa7ec0d9d A fix for Bug#5748 "Prepared statement with BETWEEN and bigint values
crashes mysqld": implementation for a generic item tree modifications
registry. Every item tree modification which should be rolled back for
subsequent execution of a prepared statement or stored procedure should
be saved in the registry. All such modifications are rolled back at once
during cleanup stage of PS.
Actual fix for the bug just adds a call to register modifications to
convert_constant_item.
Post review fixes implemented.
2004-10-08 02:21:19 +04:00
konstantin@mysql.com
48162f9653 A fix and test case for Bug#5194 "Bulk Insert Failures with Prepared
Statements": 
- fix a couple of net->buff overruns in libmysql,
- check in the server that statement parameter count is less than
  65535 (maximum value supported by prepared statements protocol).
2004-09-08 23:07:11 +04:00
monty@mysql.com
936eb4b4f4 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
2004-09-03 02:26:00 +03:00
konstantin@mysql.com
2f191db2b1 A fix and test case for Bug#4231 "Wrong result with MYSQL_TIME
parameters": when unpacking binary time recieved from client, handle
the case when length is 0: it means all MYSQL_TIME members are zero.
2004-09-02 20:16:01 +04:00
monty@mysql.com
7abae83300 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
2004-08-31 16:53:25 +03:00
monty@mysql.com
6adaff23a4 Review of new pushed code (Indentation fixes and simple optimizations)
Use 'mysqltest' as test database instead of test_$1 or test1,test2 to not accidently delete an important database
Safety fix for mailformed MERGE files
2004-08-31 14:35:04 +03:00
sergefp@mysql.com
5d3dc82daa Change Item_arena::state to enum 2004-08-31 14:07:02 +04:00
konstantin@mysql.com
522a27069f Merge: manual resolve 2004-08-24 23:07:08 +04:00
konstantin@mysql.com
ae18dc3ec8 Fix for Bug#5034 "prepared "select 1 into @arg15", second
execute crashes server": we were deleting lex->result
after each execute, but prepared statements assumed that
it's left intact.
The fix adds cleanup() method to select_result hierarchy,
so that result objects can be reused.
Plus we now need to delete result objects more wisely.
2004-08-24 20:17:11 +04:00
sergefp@mysql.com
d970586fef Fix to compile with msvc: converted static const int Item_arena::* to enum members, undefine ERROR 2004-08-24 14:44:15 +04:00
konstantin@mysql.com
75454b0a1d Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/kostja/work/mysql-4.1-4912
2004-08-21 02:08:20 +04:00
konstantin@mysql.com
568c6e8526 Fix for bug#4912 "mysqld crashs in case a statement is executed
a second time". The bug was caused by incompatibility of
negations elimination algorithm and PS: during first statement 
execute a subtree with negation was replaced with equivalent 
subtree without NOTs.
The problem was that although this transformation was permanent, 
items of the new subtree were created in execute-local memory.
The patch adds means to check if it is the first execute of a
prepared statement, and if this is the case, to allocate items
in memory of the prepared statement.
The implementation:
- backports Item_arena from 5.0
- adds Item_arena::is_stmt_prepare(), 
  Item_arena::is_first_stmt_execute().
- deletes THD::allocate_temporary_pool_for_ps_preparing(),
  THD::free_temporary_pool_for_ps_preparing(); they
  were redundant.
and adds a few invariants:
- thd->free_list never contains junk (= freed items)
- thd->current_arena is never null. If there is no
  prepared statement, it points at the thd. 
The rest of the patch contains mainly mechanical changes and
cleanups.
2004-08-21 02:02:46 +04:00
hf@deer.(none)
c43d7d92dd Merge bk@192.168.21.1:/usr/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.emb
2004-08-19 15:47:09 +05:00
hf@deer.(none)
69ee037e29 Small tab's cleanup 2004-08-19 15:38:12 +05:00
hf@deer.(none)
0ce4b28b5e addition to fixes about #4700, 4701 2004-08-19 15:36:05 +05:00
dlenev@brandersnatch.localdomain
f49d4f5350 Fix for bug #4508 "CONVERT_TZ() function with new time zone as param crashes server".
Instead of trying to open time zone tables during calculation of CONVERT_TZ() function
or setting of @@time_zone variable we should open and lock them with the rest of 
statement's table (so we should add them to global table list) and after that use such 
pre-opened tables for loading info about time zones.
2004-08-10 12:42:31 +04:00
pem@mysql.comhem.se
29662d14ec Fix for stored procedures BUG#4726: Stored procedure crash when looping over SELECT with complex WHERE's. 2004-07-23 18:42:24 +02:00
hf@deer.(none)
94bfeb8393 Fixes for bugs in embedded library:
#4700 (Unsigned value returned as signed)
    just no appropriate checking
#4701 (Errors returned earlier than expected)
    all errors returned from send_command()
#4702 (Result isn't freed properly if there's no retrieval)
    flush_use_result has only 'client' version and should
    be made 'virtual'
2004-07-22 20:54:25 +05:00
bell@sanja.is.com.ua
a1b6f6db0e LEX initialization fixed 2004-07-21 22:44:12 +03:00
bell@sanja.is.com.ua
130740248b aggregate functions check during substitution made only for single row subselects (BUG#4400)
restoring current senect pointer before PS rexecution (backport from 5.0)
removed spaces at  lines ends
2004-07-04 08:46:28 +03:00
bell@sanja.is.com.ua
4092635155 fixed EXPLAIN behaviour with prepared statements (BUG#4271) 2004-06-25 11:37:43 +03:00
konstantin@mysql.com
29b88ff539 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/kostja/mysql/mysql-4.1-4030
2004-06-24 19:09:31 +04:00
konstantin@mysql.com
a30fcdc690 Fix for Bug#4030 "Client side conversion string -> date type doesn't
work (prepared statements)" and after-review fixes:
- str_to_TIME renamed to str_to_datetime to pair with str_to_time
- functions str_to_time and str_to_TIME moved to sql-common
- send_data_str now supports MYSQL_TYPE_TIME, MYSQL_TIME_DATE,
  MYSQL_TIME_DATETIME types of user input buffers.
- few more comments in the client library
- a test case added.
2004-06-24 19:08:36 +04:00
lenz@mysql.com
79739b30e2 - fixed a compile error on Windows (incompatible cast) 2004-06-23 16:57:34 +02:00
bell@sanja.is.com.ua
cb0f607c5e Merge 2004-06-22 12:38:23 +03:00
konstantin@mysql.com
b793142c8f Unused variables removed (many files). 2004-06-21 20:39:19 +04:00
bell@sanja.is.com.ua
d2c585df31 fixed field resolving mode fo INSERT/REPLACE and CRETE with SELECT (BUG#4090) 2004-06-13 22:39:09 +03:00
konstantin@mysql.com
f3e018f833 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/kostja/mysql/mysql-4.1-4026
2004-06-09 03:22:55 +04:00
konstantin@mysql.com
dc11d3cfa1 Proposed fix for Bug#4026 "Microseconds part of TIME/DATETIME types
is broken (prepared statements)": fixed date handling in many places 
of prepared statements code.
2004-06-09 03:21:50 +04:00
sergefp@mysql.com
26a5650d1b SQL Syntax for Prepared Statements: post-merge fixes 2004-06-08 00:43:03 +04:00
sergefp@mysql.com
916579e3fd Merged 2004-06-07 12:21:26 +04:00
sergefp@mysql.com
1e05e6cb82 Post review fixes for "SQL Syntax for Prepared Statements". 2004-06-07 12:09:10 +04:00
konstantin@mysql.com
231ec66652 More comments in prepared statements code. 2004-06-06 00:33:16 +04:00
sergefp@mysql.com
dc38512390 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/dbdata/psergey/mysql-4.1-ps-merge
2004-06-01 17:29:13 +04:00
sergefp@mysql.com
e3b03d7a08 * New, binlog-aware character sets support in SQL Syntax for Prepared statements.
* The prepared statement query is put into binary log on execution only if it is an update query.
2004-06-01 17:27:40 +04:00
konstantin@mysql.com
4eaac5fa56 changed comment for LONG_DATA_COMMAND 2004-05-25 19:52:05 +04:00
sergefp@mysql.com
d7dd97089e Manually merged, requirees more merging 2004-05-25 08:15:50 +04:00
konstantin@mysql.com
f207b33a7b Support for character set conversion in binary protocol: another go
after Monty's review.
- Item_param was rewritten.
- it turns out that we can't convert string data to character set of
  connection on the fly, because they first should be written to the binary
  log.
  To support efficient conversion we need to rewrite prepared statements
  binlogging code first.
2004-05-25 02:03:49 +04:00
sergefp@mysql.com
700adb9ae9 Added support for PREPARE stmt1 FROM @var,
Fixed the problem of previous patch with replication,
More post-review fixes
2004-05-24 21:08:22 +04:00
sergefp@mysql.com
f75b1adece Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/dbdata/psergey/mysql-4.1-ps-merge
2004-05-21 04:31:07 +04:00
sergefp@mysql.com
fb17025b3e WL#1622 "SQL Syntax for Prepared Statements": Post-review fixes (1 of 2) 2004-05-21 04:27:50 +04:00