Commit graph

689 commits

Author SHA1 Message Date
konstantin@mysql.com
14344b658a A fix and a test case for Bug#10760 and complementary cleanups.
The idea of the patch
is that every cursor gets its own lock id for table level locking.
Thus cursors are protected from updates performed within the same 
connection. Additionally a list of transient (must be closed at
commit) cursors is maintained and all transient cursors are closed
when necessary. Lastly, this patch adds support for deadlock
timeouts to TLL locking when using cursors.
+ post-review fixes.
2005-07-19 22:21:12 +04:00
bell@sanja.is.com.ua
8aad35f9d2 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-bug6-5.0
2005-07-16 00:17:05 +03:00
bell@sanja.is.com.ua
6114bee47c stop evaluation constant functions in WHERE (BUG#4663)
correct value of CURRENT_USER() in SP with "security definer" (BUG#7291)
2005-07-16 00:01:44 +03:00
konstantin@mysql.com
68fb78ca33 Improve a comment. 2005-07-15 13:21:08 +04:00
dlenev@mysql.com
f334ea1fc6 Implementation of Monty's idea: Now we can open mysql.proc table for lookup
of stored routines definitions even if we already have some tables open and
locked. To avoid deadlocks in this case we have to put certain restrictions
on locking of mysql.proc table.

This allows to use stored routines safely under LOCK TABLES without explicitly
mentioning mysql.proc in the list of locked tables. It also fixes bug #11554
"Server crashes on statement indirectly using non-cached function".
2005-07-13 13:48:13 +04:00
monty@mysql.com
ec420bfb43 Fixes during review of new code
- Mostly indentation fixes
- Added missing test
- Ensure that Item_func_case() checks for stack overruns
- Use real_item() instead of (Item_ref*) item
- Fixed wrong error handling
2005-07-04 03:42:33 +03:00
bell@sanja.is.com.ua
a771b57172 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0
2005-06-23 21:45:53 +03:00
konstantin@mysql.com
4c4079430d - implement inheritance of sp_instr: public Query_arena.
We need every instruction to have its own arena, because we want to
  track instruction's state (INITIALIZED_FOR_SP -> EXECUTED). Because of 
  `if' statements and other conditional instructions used in stored 
  procedures, not every instruction of a stored procedure gets executed 
  during the first (or even subsequent) execution of the procedure. 
  So it's better if we track the execution state of every instruction 
  independently.
  All instructions of a given procedure now also share sp_head's 
  mem_root, but keep their own free_list.
  This simplifies juggling with free Item lists in sp_head::execute.
- free_items() moved to be a member of Query_arena. 
- logic of 'backup_arena' debug member of Query_arena has been
  changed to support
  multi-backups. Until now, TRUE 'backup_arena' meant that there is
  exactly one active backup of the THD arena. Now it means simply that
  the arena is used for backup, so that we can't accidentally overwrite an 
  existing backup. This allows doing multiple backups, e.g. in
  sp_head::execute and Cursor::fetch, when THD arena is already backed up
  but we want to set yet another arena (usually the 'permanent' arena,
  to save permanent transformations/optimizations of a parsed tree).
2005-06-23 20:22:08 +04:00
bell@sanja.is.com.ua
50784392aa Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug3-5.0
2005-06-23 18:30:59 +03:00
bell@sanja.is.com.ua
56b2fc10a8 fixed environment restoring in case of error during SP function execution (BUG#9503)
#define macro improvement
2005-06-23 18:29:10 +03:00
konstantin@mysql.com
6a0adade83 Remove THD::stmt_backup 2005-06-22 23:12:25 +04:00
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
9eb671459a A preparatory patch to help adding JOIN::transform() and move one-time
query transformations to the PREPARE stage (prepared statements).
2005-06-21 21:15:21 +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
f10b395982 A fix for Bug#9141 "4.1 does not log into slow log
ALTER, OPTIMIZE and ANALYZE statements".
In 4.1 we disabled logging of slow admin statements. The fix adds an 
option to enable it back.
No test case (slow log is not tested in the test suite), but tested
manually.
+ post-review fixes (word police mainly).
2005-06-16 23:05:38 +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
8c0767cef5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/opt/local/work/mysql-5.0-7306-final
2005-06-07 16:28:08 +04:00
dlenev@mysql.com
054139fc64 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-bg10015
2005-06-07 14:54:48 +04:00
dlenev@brandersnatch.localdomain
270b695f59 Fix for bug #10015 "Crash in InnoDB if stored routines are used".
We should not allow explicit or implicit transaction commits inside
of stored functions or triggers (so in autocommit mode we should not
do commits after execution of sub-statement).
Also since we don't support nested statement transactions in 5.0,
we shouldn't commit or rollback stmt transactions while we are inside
stored functions or triggers. This should be fixed in later (>=5.1)
releases.
2005-06-07 14:53:08 +04:00
konstantin@mysql.com
ac2a9eb699 Manual merge. 2005-06-07 14:50:45 +04:00
konstantin@mysql.com
9f379d7f05 Patch two (the final one) for Bug#7306 "the server side preparedStatement
error for LIMIT placeholder".
The patch adds grammar support for LIMIT ?, ? and changes the
type of ST_SELECT_LEX::select_limit,offset_limit from ha_rows to Item*,
so that it can point to Item_param.
2005-06-07 14:11:36 +04:00
jani@a193-229-222-105.elisa-laajakaista.fi
f2933263fb A fix for systems that don't have HAVE_MMAP defined.
Moved some variable externs from sql_class.h to mysql_priv.h
2005-06-07 11:30:09 +03:00
monty@mysql.com
4b7882dc73 merge 2005-06-05 17:19:50 +03:00
konstantin@mysql.com
123bcb9d8d Give Item_arena::is_stmt_prepare a more descriptive name (it marks
the code that is active for SP as well in 5.0)
2005-06-03 00:02:47 +04:00
monty@mysql.com
7538ce70d5 Fixed bug in multiple-table-delete where some rows was not deleted 2005-05-30 20:48:40 +03:00
sergefp@mysql.com
59db44382b Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-conf-fixes-2
2005-05-26 21:01:53 +02:00
sergefp@mysql.com
b6179919f3 Change Last_query_cost status variable from global to thread-local. 2005-05-18 05:39:10 +02:00
msvensson@neptunus.(none)
34cec09efb Merge neptunus.(none):/home/msvensson/mysql/bug10241
into neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-05-09 11:26:48 +02:00
holyfoot@hf-ibm.(none)
2c8e9df232 A lot of fixes to Precision math
Mostly about precision/decimals of the results of the operations
2005-05-05 20:06:49 +05:00
msvensson@neptunus.(none)
5b5565c30a BUG#10241 cygwin port: invalid pragma interface directives
- Introduce ifdefs so we can control when to use #pragma interface on cygwin
2005-05-04 15:05:56 +02:00
serg@serg.mylan
c796ea598c Merge 2005-04-05 13:23:11 +02:00
serg@serg.mylan
810b2c3d40 remove the rest of isam/merge references
fix a race condition in TC_LOG_BINLOG::unlog
2005-04-05 13:17:49 +02:00
monty@mysql.com
48de1ff277 Don't generate message in send_kill_message() if wrong data. (Caused core dump for wrong data in ALTER TABLE on some system) 2005-04-05 01:19:48 +03:00
monty@mysql.com
04f8e164fb Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-04-04 16:45:23 +03:00
monty@mysql.com
201ee3eb78 Invalid DEFAULT values for CREATE TABLE now generates errors. (Bug #5902)
CAST() now produces warnings when casting a wrong INTEGER or CHAR values. This also applies to implicite string to number casts. (Bug #5912)
ALTER TABLE now fails in STRICT mode if it generates warnings.
Inserting a zero date in a DATE, DATETIME or TIMESTAMP column during TRADITIONAL mode now produces an error. (Bug #5933)
2005-04-01 15:04:50 +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
jimw@mysql.com
ee2b4ec959 Eliminate warnings noticed by VC7. This includes fixing my_mmap() on
Windows to call CreateFileMapping() with correct arguments, and
propogating the introduction of query_id_t to everywhere query ids are
passed around. (Bug #8826)
2005-03-18 16:12:25 -08:00
msvensson@neptunus.(none)
3f8a66cbea Merged WL#2269 to mysql-5.0 2005-03-15 15:22:40 +01:00
konstantin@mysql.com
6a2ef5577c WL#926 "AVG(DISTINCT) and other distincts", part 2 (out of 3): clean up
Item_sum_count_distinct, and
deploy Unique for use with COUNT(DISTINCT) if there is no blob
column in the list of DISTINCT arguments.
2005-03-15 03:46:19 +03:00
heikki@hundin.mysql.fi
a95f09e228 set_var.cc, mysqld.cc, ha_innodb.cc, sql_class.h:
Add a settable session variable innodb_support_xa; setting it to 0 can save up to 10 % of CPU time and 150 bytes of space in each undo log
trx0trx.h, trx0undo.c, trx0trx.c, trx0roll.c:
  Enable XA if innodb_support_xa is not set to 0; make prepare to do log fsync's according to innodb_flush_log_at_trx_commit
2005-03-13 12:49:39 +02:00
msvensson@neptunus.(none)
c94952d1f0 Removed unused variable 2005-03-10 10:43:11 +01:00
serg@serg.mylan
c49928447d Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-03-09 13:02:51 +01:00
serg@serg.mylan
1e09c15a8b don't close binlog in the destructor - use explictit MYSQL_LOG::cleanup for this 2005-03-09 12:29:51 +01:00
jani@ua141d10.elisa.omakaista.fi
8db4423b8c Fixed Bug#8922.
Reverted Jim's patch.
2005-03-08 18:12:12 +02:00
jimw@mysql.com
fd6e7c878e Re-enable IO cache mode that allows slow and query logs to go to a FIFO
(lost in merge because the code to open these logs was moved to a different
file).
2005-03-07 13:56:58 -08:00
dlenev@mysql.com
5b16dbf960 Manual merge SP-locking improvements patch with current tree. 2005-03-04 17:46:45 +03:00