Commit graph

275 commits

Author SHA1 Message Date
konstantin@mysql.com
b2ff38202d A fix and a test case for Bug#12736 "Server crash during a select".
The bug was in JOIN::join_free which was wrongly determining that
all joins have been already executed and therefore all used tables
can be closed.
2005-10-13 11:53:00 +04:00
konstantin@mysql.com
6f8d3c4844 A fix and a test case for Bug#6513 "Test Suite: Values inserted by using
cursor is interpreted latin1 character and Bug#9819 "Cursors: Mysql Server
Crash while fetching from table with 5 million records."
A fix for a possible memory leak when fetching into an SP cursor
in a long loop.
The patch uses a common implementation of cursors in the binary protocol and 
in stored procedures and implements materialized cursors.
For implementation details, see comments in sql_cursor.cc
2005-09-22 02:11:21 +04: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
monty@mysql.com
4c0d23e156 Fixes during review of new pushed code
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
2005-08-12 13:54:42 +03:00
sergefp@mysql.com
65566e449d Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-bug11869-part3
2005-08-07 21:32:26 +00:00
sergefp@mysql.com
0dba629a5e Manual merge 2005-08-07 21:30:46 +00:00
sergefp@mysql.com
d9ce6e8f25 BUG#11869:part 2: post-review fixes: merging into 5.0
We're out of bits in st_select_lex->options so make TMP_TABLE_FORCE_MYISAM ==
OPTION_FOUND_COMMENT (the latter is not used by create_tmp_table).
2005-08-07 21:21:30 +00:00
sergefp@mysql.com
d820a09a68 BUG#11869: part2: post-review fixes:
In init_prepare_fake_select_lex() don't empty ftfunc_list. UNION's ORDER BY clause may 
contain MATCH(...), for which fix_index() should be called.
2005-08-07 21:03:45 +00:00
sergefp@mysql.com
c3bac658be Manual merge 2005-08-07 11:03:54 +00:00
sergefp@mysql.com
5e9545d4c4 BUG#11869 (cont'd, eliminating "table type doesn't support FULLTEXT" error):
When creating temporary table for UNION, pass TMP_TABLE_FORCE_MYISAM flag to 
create_tmp_table if we will be using fulltext function(s) when reading from the 
temp. table.
2005-08-06 21:08:28 +00:00
evgen@moonbone.local
fa0ea36507 Fix bug #11335 View redefines TinyInt(1) column definition
Item_type_holder doesn't store information about length and exact type of
original item which results in redefining length to max_length and geometry 
type to longtext.

Changed the way derived tables except unions are built. Now they are created
from original field list instead of list of Item_type_holder.
2005-07-30 05:53:35 +04:00
jimw@mysql.com
f1ac600a7e Merge jwinstead@production.mysql.com:my/mysql-5.0-11045
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-06 16:49:04 -07:00
monty@mysql.com
fe30ec9032 manual merge 2005-07-04 03:50:04 +03: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
d3905f3d0e Name resolution context added (BUG#6443) 2005-07-01 07:05:42 +03:00
bell@sanja.is.com.ua
a01f9d5bcd fixed SP parameter execution 2005-06-29 11:50:29 +03:00
konstantin@mysql.com
56a37f8e07 - don't call JOIN::join_free(1) twice for every join in JOIN::cleanup().
The reason it happened was that both, JOIN::cleanup() and JOIN::join_free(),
went over all nested joins and called cleanup/join_free for them.
For that:
- split recursive and non-recursive parts of JOIN::cleanup() and
JOIN::join_free()
- rename JOIN::cleanup to JOIN::destroy, as it actually destroys its
  argument
- move the recursive part of JOIN::cleanup to st_select_lex::cleanup
- move the non-recursive part of JOIN::join_free to the introduced
  method JOIN::cleanup().
2005-06-24 22:48:12 +04:00
jimw@mysql.com
f2b0874f80 Clean up warnings and build problems on Windows. (Bug #11045) 2005-06-18 01:55:42 +02: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
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
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
konstantin@mysql.com
19b8379af6 One more post-review fix. 2005-05-30 21:49:59 +04:00
konstantin@mysql.com
2d6a70c42a Preparatory (and the most problematic) patch for Bug#7306
"the server side preparedStatement error for LIMIT placeholder",
which moves all uses of LIMIT clause from PREPARE to OPTIMIZE
and later steps.
After-review fixes.
2005-05-30 20:54:37 +04: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
dcdda90a11 Merge 2005-03-30 10:27:36 +03:00
pekka@mysql.com
727015dbb3 Merge 2005-03-28 23:06:19 +02:00
serg@serg.mylan
f21f8f983f client/mysqltest.c
corrected number of fields for --enable_metadata
sql/sql_union.cc
    fixed a apparent typo in assert
2005-03-23 20:38:42 +01: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
ramil@mysql.com
de1153b5e6 manual merge 2005-03-03 14:29:37 +04:00
ramil@mysql.com
89a105abc5 a fix for --ps-protocol (bug #6089: FOUND_ROWS returns wrong values when no table/view is used) 2005-03-02 20:00:48 +04: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
monty@mysql.com
cd78e701a5 Show all generated warnings in SHOW ERROR
Previously we only stored the first given error (the error sent to the client)
2005-02-24 23:33:42 +02:00
jimw@mysql.com
8c8553af81 Merge changes 2005-02-04 11:59:02 -08:00
gluh@gluh.mysql.r18.ru
34915f7a91 A fix: bug#6931: Date Type column problem when using UNION-Table
bug#7833:  Wrong datatype of aggregate column is returned
2005-02-04 15:31:36 +03:00
Sinisa@sinisa.nasamreza.org
a2e0ecbf03 after merge fixes 2005-01-18 23:34:15 +02:00
Sinisa@sinisa.nasamreza.org
477047401c fixing wrong value for "examined rows" when UNION's are used. 2005-01-18 23:13:29 +02:00
monty@mysql.com
d35140a851 First stage of table definition cache
Split TABLE to TABLE and TABLE_SHARE (TABLE_SHARE is still allocated as part of table, will be fixed soon)
Created Field::make_field() and made Field_num::make_field() to call this
Added 'TABLE_SHARE->db' that points to database name; Changed all usage of table_cache_key as database name to use this instead
Changed field->table_name to point to pointer to alias. This allows us to change alias for a table by just updating one pointer.
Renamed TABLE_SHARE->real_name to table_name
Renamed TABLE->table_name to alias
Renamed TABLE_LIST->real_name to table_name
2005-01-06 13:00:13 +02:00
monty@mysql.com
309b1a2b6c Merge with 4.1 tree to get fix for INSERT IGNORE ... ON DUPLICATE KEY 2005-01-03 23:04:52 +02:00
monty@mysql.com
2299e1eca4 Better handling of ensuring that setup_tables() are not called twice
This fixed a bug in prepared statements when used with outher joins
Fixed a bug in SUM(DISTINCT) when used with prepared statements.
Some safety fixes in test scripts to ensure that previous test failures shouldn't affect other tests
2005-01-03 21:04:33 +02:00
monty@mysql.com
1bd22faa05 Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
This allows use to use INSERT IGNORE ... ON DUPLICATE ...
2004-12-31 12:04:35 +02:00
monty@mishka.local
4f4bbfc279 Merge with 4.1 2004-12-22 13:54:39 +02:00
bell@sanja.is.com.ua
f5e253dc2f reporting empty result added in case of max/min optimisation of ALL/ANY/SOME subqueries
fixed null processing in NOT operation used in ALL subquery (Bug #6247)
2004-11-18 18:10:07 +02:00
bell@sanja.is.com.ua
1555469b64 merge 2004-11-12 15:36:31 +02:00
bell@sanja.is.com.ua
31f7811183 post-review fixes 2004-11-12 14:34:00 +02:00
monty@mysql.com
2bba55b57f After merge fixes
Added push_back(void *, MEM_ROOT *) to make some list-handling code easier that needs to be allocated in a different mem-root
(Before one had to change thd->mem_root ; push_back(); restore mem_root.
2004-11-09 03:58:44 +02:00
monty@mysql.com
1087186657 Merge with 4.1 to get new thd->mem_root handling 2004-11-08 17:53:32 +02:00
monty@mysql.com
b903a129e2 Simpler arena swapping code
Now thd->mem_root is a pointer to thd->main_mem_root and THR_MALLOC is a pointer to thd->mem_root.
This gives us the following benefits:
- Allow us to easily detect if arena has already been swapped before (this fixes a bug in setup_conds() where arena was swaped twice in some cases)
- Faster swaps of arenas (as we don't have to copy the whole MEM_ROOT)
- We don't anymore have to call my_pthread_setspecific_ptr(THR_MALLOC,...) to change where memory is alloced. Now it's enough to set thd->mem_root
2004-11-08 01:13:54 +02:00
monty@mysql.com
afbe601302 merge with 4.1 2004-10-29 19:26:52 +03:00
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
konstantin@mysql.com
e3abcb6b53 A fix and test case for Bug#6088 "FOUND_ROWS returns wrong values for
prepared statements when LIMIT is used" and post-review comments.
The fix changes the approach we calculate the need for ORDER BY 
in UNION: the previous was not PS friendly, as it damaged SELECT_LEX 
options in case of single select.
2004-10-22 22:51:16 +04:00