Commit graph

710 commits

Author SHA1 Message Date
dlenev@mysql.com
2a96aa110f Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg12704-2
2005-09-15 03:57:59 +04:00
dlenev@mysql.com
e231ebe5fb Fix for bug #12704 "Server crashes during trigger execution".
This bug occurs when some trigger for table used by DML statement is created
or changed while statement was waiting in lock_tables(). In this situation
prelocking set which we have calculated becames invalid which can easily lead
to errors and even in some cases to crashes.

With proposed patch we no longer silently reopen tables in lock_tables(),
instead caller of lock_tables() becomes responsible for reopening tables and
recalculation of prelocking set.
2005-09-15 03:56:09 +04:00
evgen@moonbone.local
62fa6c5eae Merge 2005-09-13 22:22:51 +04:00
ingo@mysql.com
7953594a4d Bug#12845 - Stress test: Server crashes on CREATE .. SELECT statement
Solution for 5.0.
Changed calls to open_table(). Requested to ignore
flush at places where the command did already lock tables.
This could happen in CREATE ... SELECT and ALTER TABLE.

No test case. The bug can only be triggered by true concurrency.
The stress test suite provides a test case for this.
2005-09-13 14:36:43 +02:00
timour@mysql.com
6a528590d9 Fix for BUG#13067 "JOIN ... USING is case sensitive". 2005-09-12 08:28:53 +03:00
evgen@moonbone.local
75841099ca Fix bug #12993 View column rename broken in subselect
When view column aliased in subselect alias is set on ref which represents
field. When tmp table is created for subselect, it takes name of original field
not ref. Because of this alias on view column in subselect is lost. Which
results in reported error.

Now when alias is set on ref, it's set on ref real item too.
2005-09-12 02:46:35 +04:00
andrey@lmy004.
f93c54205d Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.0
into lmy004.:/work/mysql-5.0-bug12651
2005-09-09 09:10:56 +02:00
andrey@lmy004.
1a46ea1057 fix for bug #12651 (item of a prepared query allocated on non-permanent
are thus dangling later)
2005-09-08 21:30:05 +02:00
timour@mysql.com
912aef9579 Fix for BUG#12977. 2005-09-08 11:29:52 +03:00
bell@sanja.is.com.ua
8553349638 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-09-02 17:06:15 +03:00
konstantin@mysql.com
a3ddcdf8fb Rename:
- current_arena to stmt_arena: the thread may have more than one
'current' arenas: one for runtime data, and one for the parsed 
tree of a statement. Only one of them is active at any moment.
- set_item_arena -> set_query_arena, because Item_arena was renamed to 
Query_arena a while ago
- set_n_backup_item_arena -> set_n_backup_active_arena;
the active arena is the arena thd->mem_root and thd->free_list
are currently pointing at.
- restore_backup_item_arena -> restore_active_arena (with the same
rationale)
- change_arena_if_needed -> activate_stmt_arena_if_needed; this
method sets thd->stmt_arena active if it's not done yet.
2005-09-02 17:21:19 +04:00
bell@sanja.is.com.ua
da64c1eab3 postmerge changes 2005-09-02 09:50:17 +03:00
bell@sanja.is.com.ua
dd7ab17059 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-09-01 22:42:37 +03:00
monty@mishka.local
05ee47a80d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mishka.local:/home/my/mysql-5.0
2005-08-25 00:22:59 +03:00
monty@mishka.local
bb7289b7d2 Cleanups during review of new code
Removed ASSERT that can obviously never be wrong
2005-08-25 00:21:47 +03:00
timour@mysql.com
04a6a8e011 Post-fix for BUG#6276. 2005-08-24 10:51:28 +03:00
bell@sanja.is.com.ua
144c847da6 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-08-23 23:17:36 +03:00
timour@mysql.com
9a6aefab3a Fix for BUG#6276. 2005-08-23 20:03:32 +03:00
timour@mysql.com
bf8563ae1d Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486
2005-08-23 18:15:51 +03:00
timour@mysql.com
e040300393 WL#2486 - natural and using join according to SQL:2003
* Provide backwards compatibility extension to name resolution of
  coalesced columns. The patch allows such columns to be qualified
  with a table (and db) name, as it is in 4.1.
  Based on a patch from Monty.

* Adjusted tests accordingly to test both backwards compatible name
  resolution of qualified columns, and ANSI-style resolution of
  non-qualified columns.
  For this, each affected test has two versions - one with qualified
  columns, and one without.
2005-08-23 18:08:04 +03:00
dlenev@mysql.com
603dddfdb4 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg11896
2005-08-23 09:15:05 +04:00
monty@mishka.local
d62295e44e Cleanup during review of new pushed code 2005-08-22 01:13:37 +03:00
monty@mishka.local
ba2ace25a9 Merge mishka.local:/tmp/skr99/mysql-5.0
into  mishka.local:/home/my/mysql-5.0
2005-08-21 13:05:15 +03:00
monty@mishka.local
1c1f26d5e2 Fixes during review of new pushed code
Fixed new bug when running a SP without a default database
2005-08-20 11:00:00 +03:00
timour@mysql.com
f5fc1543aa WL#2486 - natural and using join according to SQL:2003
- Corrected problem with N-way nested natural joins in PS mode.
- Code cleanup
- More asserts to check consistency of name resolution contexts
- Fixed potential memory leak of name resolution contexts
2005-08-19 15:22:30 +03:00
dlenev@mysql.com
6c39364f85 Fix for bug #11896 "Partial locking in case of recursive trigger definitions".
If we are in stored function or trigger we should ensure that we won't change
table that is already used by calling statement (this can damage table or
easily cause infinite loops). Particularly this means that recursive triggers
should be disallowed.
2005-08-18 19:07:23 +04:00
timour@mysql.com
a55786ca70 WL#2486 - natural and using join according to SQL:2003
- fixed a problem with RIGHT JOIN ON and enabled corresponding tests in select.test
- fixed a memory leak
2005-08-17 17:19:31 +03:00
timour@mysql.com
0671228b05 Fixed code formatting. 2005-08-17 14:20:01 +03:00
timour@mysql.com
066e3c4209 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486
2005-08-17 13:47:16 +03:00
timour@mysql.com
c8e55a35b3 WL#2486 - Process NATURAL and USING joins according to SQL:2003
- Applied Monty's patch after his review of sql_base.cc
2005-08-17 13:46:36 +03:00
andrey@lmy004.wdf.sap.corp
c896ca1a10 fix for bug #12183 "SHOW OPEN TABLES behavior doesn't match grammar"
(after review commit)
2005-08-16 11:18:35 +02:00
monty@mysql.com
1a6f16edd9 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2005-08-15 18:35:48 +03:00
serg@sergbook.mysql.com
d42f973b80 merged 2005-08-12 22:58:13 +02:00
serg@sergbook.mysql.com
f5ff607c14 BUG#12162 - one can start two transactions with the same XID.
Now we keep all active XID's in a hash
2005-08-12 21:15:01 +02:00
timour@mysql.com
354ce1d024 Merge mysql.com:/home/timka/mysql/src/5.0-virgin
into  mysql.com:/home/timka/mysql/src/5.0-2486-merge
2005-08-12 19:27:54 +03:00
timour@mysql.com
a247282aa6 Implementation of WL#2486 -
"Process NATURAL and USING joins according to SQL:2003".

* Some of the main problems fixed by the patch:
  - in "select *" queries the * expanded correctly according to
    ANSI for arbitrary natural/using joins
  - natural/using joins are correctly transformed into JOIN ... ON
    for any number/nesting of the joins.
  - column references are correctly resolved against natural joins
    of any nesting and combined with arbitrary other joins.

* This patch also contains a fix for name resolution of items
  inside the ON condition of JOIN ... ON - in this case items must
  be resolved only against the JOIN operands. To support such
  'local' name resolution, the patch introduces a stack of
  name resolution contexts used at parse time.

NOTICE:
- This patch is not complete in the sense that
  - there are 2 test cases that still do not pass -
    one in join.test, one in select.test. Both are marked
    with a comment "TODO: WL#2486".
  - it does not include a new test specific for the task
2005-08-12 17:57:19 +03:00
monty@mysql.com
4963388cc1 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2005-08-12 13:57:20 +03:00
igor@rurik.mysql.com
da441e949c sql_base.cc:
Fixed bug #12470.
  A misplaced initialization of the cond_count counter
  resulted in a wrong calculation of it. This caused a memory
  corruption since this counter was used as a parameter of
  some memory allocation.
view.test:
  Added a test case for bug #12470.
2005-08-12 01:27:04 -07:00
igor@rurik.mysql.com
0aff8a13dc sql_base.cc:
Fixed bug #12382.
  INSERT statement effectively changed thd->set_query_id to 0,
  while SELECT statement changed it to 0. As a result
  the insert_fields function that expanded '*' was called
  with different values of thd->set_query_id for the query
  SELECT * FROM view depending on whether it was run after
  an INSERT or after a SELECT statement. This was corrected
  by restoring the old value of thd->set_query_id when
  returning from the function setup_fields where possible
  reset could occur.
  If the value of thd->set_query_id == 0 then the fields
  substituted instead of '*' were not registered as used
  for bitmaps used_keys. This caused selection of an invalid
  execution plan for the query SELECT * from <view>.
view.result, view.test:
  Added a test case for bug #12382.
2005-08-11 16:10:34 -07:00
monty@mysql.com
e80252e53c Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2005-08-11 16:43:22 +03:00
monty@mysql.com
7b80e62528 Cleanups during review of new code 2005-08-11 15:58:15 +03:00
dlenev@mysql.com
0c38d33507 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-is
2005-08-09 11:43:55 +04:00
dlenev@mysql.com
615baa9f23 Fix for bug #10055 "Using stored function with information_schema causes empty
result set".

To enable full access to contents of I_S tables from stored functions
or statements that use them, we manipulate with thread's open tables
state and ensure that we won't cause deadlock when we open tables by
ignoring flushes and name-locks.
Building of contents of I_S.TABLES no longer requires locking of tables
since we use use handler::info() method with HA_STATUS_AUTO flag instead
of handler::update_auto_increment() for obtaining information about
auto-increment values. But this also means that handlers have to implement
support for HA_STATUS_AUTO flag (particularly InnoDB needs it).
2005-08-08 17:46:06 +04:00
sergefp@mysql.com
f595847ec0 Manual merge 2005-08-03 03:47:07 +00:00
sergefp@mysql.com
b6a6fe0849 Prelocking-free SPs, post-review fixes:
* Don't activate prelocking mode for evaluating procedure arguments when it is not necessary.
* Code structure simplification and cleanup.
* Cleanup in .test files
2005-08-03 03:37:32 +00:00
bell@sanja.is.com.ua
4c69fbe632 issue correct error message in case of view presence for duplicated table on update (BUG#10773)
frequently used command sequence replaced with inline function
2005-08-02 22:54:49 +03:00
monty@mishka.local
8437e9c1be Fixes during review of new pushed code
Change bool in C code to my_bool
Added to mysqltest --enable_parsning and --disable_parsing to avoid to have to comment parts of tests
Added comparison of LEX_STRING's and use this to compare file types for view and trigger files.
2005-07-31 12:49:55 +03:00
sergefp@mysql.com
de02193bdd Added Non-prelocked SP execution: Now a PROCEDURE doesn't enter/leave prelocked mode for
its body, but lets each statement to get/release its own locks. This allows a broader set
of statements to be executed inside PROCEDUREs (but breaks replication)
This patch should fix BUG#8072, BUG#8766, BUG#9563, BUG#11126
2005-07-30 08:19:57 +00:00
monty@mysql.com
15d48525af Merge mysql.com:/home/my/mysql-4.1
into  mysql.com:/home/my/mysql-5.0
2005-07-28 17:09:54 +03:00
monty@mysql.com
b3cbd0048f Cleanups during review of new code
Ensure mysql_close() is called if mysql_set_character_set() fails
2005-07-28 16:10:14 +03:00