Commit graph

337 commits

Author SHA1 Message Date
konstantin@mysql.com
a1bec5666f Adjust to the changed Query_arena constructor:
main_mem_root is moved out of class Query_arena.
2005-06-22 11:59:13 +04:00
konstantin@mysql.com
b875f7902d Fix a formatting bug and add a test for it. 2005-06-20 15:38:15 +04:00
konstantin@mysql.com
362a83d2f2 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-10736
2005-06-17 23:27:23 +04:00
konstantin@mysql.com
b3d977df10 Rename all prepared statements COM_ commands to prefix with COM_STMT_ 2005-06-17 23:26:25 +04:00
serg@serg.mylan
516d0945a1 Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-06-17 11:29:55 +02:00
konstantin@mysql.com
4f966145b0 Post-merge fixes. 2005-06-17 01:58:36 +04:00
konstantin@mysql.com
62dacf0813 Manual merge (4.1->5.0) 2005-06-17 00:34:35 +04:00
konstantin@mysql.com
dcb0e65dcb Fix Bug#9334 "PS API queries in log file" and
Bug#8367 "low log doesn't gives complete information about prepared 
statements"
Implement status variables for prepared statements commands (a port of
the patch by Andrey Hristov).
See details in comments to the changed files.
No test case as there is no way to test slow log/general log in 
mysqltest.
2005-06-17 00:11:48 +04:00
serg@serg.mylan
01b3c70926 renamed:
Item_buff -> Cached_item
  Item_arena -> Query_arena
  TEST_ASSERT -> YYERROR_UNLESS
2005-06-15 19:58:35 +02:00
konstantin@mysql.com
95e620485c A fix and test case for Bug#10729 "mysql_stmt_attr_set
CURSOR_TYPE_READ_ONLY". The bug was that we (me) don't perform proper
cleanups of the prepared statement when done fetching from a cursor.
Another patch.
2005-06-09 18:17:45 +04:00
dlenev@mysql.com
fae0b7f7af Manual merge 2005-06-09 01:13:20 +04:00
dlenev@brandersnatch.localdomain
5394a1a4bd Fix for bug #11158 "Can't perform multi-delete in stored procedure".
In order to make multi-delete SP friendly we need to have all table 
locks for the elements of main statement table list properly set 
at the end of parsing.

Also performed small cleanup: We don't need relink_tables_for_multidelete()
any longer since the only case now when TABLE_LIST::correspondent_table
is non-zero are tables in auxilary table list of multi-delete and these
tables are handled specially in mysql_multi_delete_prepare().
2005-06-09 01:07:52 +04:00
konstantin@mysql.com
a2bf13cde6 Trim trailing spaces. 2005-06-08 19:57:26 +04:00
konstantin@mysql.com
f0ee736991 Cleanup sql_prepare.cc 2005-06-08 19:31:34 +04:00
konstantin@mysql.com
79b82323e3 A followup patch for Bug#7306 (limit in prepared statements):
don't evaluate subqueries during statement prepare, even if they
are not correlated.
With post-review fixes.
2005-06-08 00:34:53 +04:00
monty@mysql.com
7d70579917 Fixed failing tests for not 32 bit intel machines
Fixed bug in mysql_stmt_fetch() when retrieving rows to return
2005-05-16 13:34:23 +03:00
konstantin@mysql.com
7ca3f018e7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/media/sda1/mysql/mysql-5.0-9478
2005-05-12 11:17:38 +04:00
konstantin@mysql.com
d0e24153b9 A fix and test case for Bug#9478 "mysql_stmt_attr_set mysql_stmt_execute"
(crash on attempt to re-execute a statement with an open cursor) + 
post-review fixes.
2005-05-12 11:16:12 +04:00
igor@rurik.mysql.com
3351233349 Manual merge 2005-05-10 16:41:47 -07:00
igor@rurik.mysql.com
9d4b228b61 Many files:
Fixed bug #8528.
  Representation for single-table views was made similar to
  representation for multi-table views.
view.test:
  Added test case for bug #8528.
view.result:
  Added test case for bug #8528. Fixed other test cases.
2005-05-10 16:31:13 -07:00
konstantin@mysql.com
6040b0abf6 A fix and a test case for Bug#9520 "SELECT DISTINCT crashes server
with cursor". The patch refactors do_select/sub_select
functions, which implement the nested loop algorithm, and reuses them to
fetch rows for cursors as well.
Pushing with view.test failing (--ps-protocol).
2005-04-30 09:54:35 +04:00
dlenev@mysql.com
51ca05b6e3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg9486
2005-04-22 10:51:04 +04:00
dlenev@brandersnatch.localdomain
6b0b4734d9 Fix for bug #9486 "Can't perform multi-update in stored procedure".
New more SP-locking friendly approach to handling locks in multi-update.
Now we mark all tables of multi-update as needing write lock at parsing
stage and if possible downgrade lock at execution stage (For its work
SP-locking mechanism needs to know all lock types right after parsing
stage).
2005-04-15 20:31:47 +04:00
konstantin@mysql.com
ced4317774 Allow SQLCOM_CALL in prepared mode. 2005-04-13 12:36:15 -07:00
bell@sanja.is.com.ua
05c9defefa Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-multi-5.0
2005-04-01 13:02:29 +03:00
bell@sanja.is.com.ua
05d4ed14e4 merge 4.1->5.0 2005-03-31 10:39:48 +03:00
bell@sanja.is.com.ua
1659dacab1 fixed mechanism of detection selection from table wich we update
(BUG##9398, BUG#8703)
fixed wrong join view detection in multi-delete which lead to server crash
2005-03-28 15:13:31 +03:00
konstantin@mysql.com
a8c1316c6b Manual merge 2005-03-24 15:17:39 +03:00
konstantin@mysql.com
fd54ee4539 Fixes and test cases for Bug#8880 "Commands out of sync error with cursors"
and Bug#9159 "Server crash during mysql_stmt_close".
The patch adds support for single-row result sets in cursors.
2005-03-24 15:12:53 +03:00
bell@sanja.is.com.ua
4554b1f263 fixed union types merging and table related metadata (BUG#8824) 2005-03-23 08:36:48 +02:00
serg@serg.mylan
376a4ee03b Field::quote_data():
don't call escape_string_for_mysql() unnecesary
  don't overwrite local buffer
escape_string_for_mysql():
  take a length of the destination buffer as an argument
2005-03-17 12:27:45 +01:00
monty@mysql.com
594ef41b2d Cleanup during reviews
Removed some optional arguments
Fixed portability problem in federated tests
2005-03-16 16:11:01 +02:00
dlenev@brandersnatch.localdomain
3b6aeddc11 Fix for sp.test failure in --ps-protocol mode (2nd attempt).
Now we should call open_and_lock_tables() even if table list is empty -
to cache stored routines used by query and open and lock tables required
for their execution.
2005-03-10 16:05:48 +03:00
dlenev@brandersnatch.localdomain
e6a506c397 Fix for yet another memleak caused by SP-locking patch.
Improved handling of situations when we encounter error during
CREATE PROCEDURE (FUNCTION/TRIGGER/...) and bail out of yyparse()
without restoring proper THD::lex.
2005-03-05 16:31:58 +03:00
dlenev@mysql.com
5b16dbf960 Manual merge SP-locking improvements patch with current tree. 2005-03-04 17:46:45 +03:00
dlenev@brandersnatch.localdomain
5a6c7027f0 Better approach for prelocking of tables for stored routines execution
and some SP-related cleanups.

- We don't have separate stage for calculation of list of tables
  to be prelocked and doing implicit LOCK/UNLOCK any more.
  Instead we calculate this list at open_tables() and do implicit
  LOCK in lock_tables() (and UNLOCK in close_thread_tables()).
  Also now we support cases when same table (with same alias) is
  used several times in the same query in SP.

- Cleaned up execution of SP. Moved all common code which handles
  LEX and does preparations before statement execution or complex
  expression evaluation to auxilary sp_lex_keeper class. Now 
  all statements in SP (and corresponding instructions) that
  evaluate expression which can contain subquery have their
  own LEX.
2005-03-04 16:35:28 +03:00
konstantin@mysql.com
fe2d63a060 Fixes for bug#8115 "Server Crash with prepared statement"
and bug#8849 "problem with insert statement with table alias's": 
make equality propagation work in stored procedures and prepared 
statements.
Equality propagation can change AND/OR structure of ON expressions,
so the fix is to provide each execution of PS/SP with it's own
copy of AND/OR tree. We have been doing that already for WHERE clauses,
now ON clauses are also copied.
2005-03-03 17:38:59 +03:00
monty@mysql.com
0a6b7aedb2 Remove compiler warnings and remove not used variables
(Found during build process)
2005-02-25 16:53:22 +02:00
hf@deer.(none)
96558f6ad3 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.clean
2005-02-09 02:54:08 +04:00
hf@deer.(none)
b94a482ee9 Precision Math implementation 2005-02-09 02:50:45 +04:00
pem@mysql.comhem.se
2c26ebe359 WL#2130: Table locking for stored FUNCTIONs
Collect all tables and SPs refered by a statement, and open all tables
with an implicit LOCK TABLES. Do find things refered by triggers and views,
we open them first (and then repeat this until nothing new is found), before
doing the actual lock tables.
2005-02-08 20:52:50 +01:00
monty@mysql.com
0a1076a25f Merge with 4.1 2005-01-15 14:09:45 +02:00
monty@mysql.com
249f914c21 Fix bug in INSERT DELAYED with prepared statements
The bug was that if you have two TL_WRITE_DELAYED at the same time,
mi_lock_databases() could be done in the wrong order and we could write the wrong header to the MyISAM index file.
2005-01-14 00:09:15 +02:00
konstantin@mysql.com
019ff4c577 Manual merge. 2005-01-13 02:19:35 +03:00
konstantin@mysql.com
30c4d10e1a Add logging of COM_EXECUTE in the general query log. 2005-01-13 02:13:19 +03:00
monty@mysql.com
ef74d8d898 Fixed a bug in prepared statements error handling
After merge fixes
2005-01-06 16:59:29 +02:00
bell@sanja.is.com.ua
e3045e85f3 added correct res initialisation
and check of handler compatibility
2005-01-05 17:42:22 +02:00
bell@sanja.is.com.ua
a8a5f3590c fixed bugs in view code with prepared statemnts 2005-01-04 18:04:16 +02:00
monty@mysql.com
7cf8285b3f After merge fixes
Add support for warnings for prepare of prepared statements
Fixed test to work with --ps-protocol
Fixed some test results
2005-01-04 13:46:53 +02:00
bell@sanja.is.com.ua
8c39a4f463 fixed reporting error 2005-01-03 22:16:54 +02:00