Commit graph

304 commits

Author SHA1 Message Date
msvensson@neptunus.(none)
83d430353e Add ifdefs to control when "#pragma implementation" should be used
Added some more ifdefs for "#pragma interface"
2005-05-26 12:09:14 +02:00
bell@sanja.is.com.ua
1029e533df postmerge 4.1->5.0 fixes 2005-04-01 02:14:30 +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
4fdb0f48e7 postreview changes
fixed bug in IN/ALL/ANY subqeries with HAVING clause (BUG#9350)
2005-03-30 10:07:08 +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
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
bell@sanja.is.com.ua
056d5a3934 fixed left expression of IN/ALL/ANY subquery transformation support (BUG#8888) 2005-03-10 14:01:22 +02: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
a1a39fab84 Merge with 4.1 2005-02-10 02:27:37 +02:00
bell@sanja.is.com.ua
90c0024217 reverted patch for BUG#7351 (because of performance ussie) 2005-02-09 21:08:08 +02:00
hf@deer.(none)
b94a482ee9 Precision Math implementation 2005-02-09 02:50:45 +04:00
monty@mysql.com
80b3e02462 Fixed bug detected by sp-tests
Cleanup during reviews of new pushed code
2005-02-05 16:05:46 +02:00
monty@mysql.com
422c2eb868 4.1 -> 5.0 merge 2005-02-03 13:18:30 +02:00
bell@sanja.is.com.ua
0bf6e3aefc fixed cleanup of result object of subqueries. (BUG#8125) 2005-01-26 15:27:45 +02:00
bell@sanja.is.com.ua
2371c992de check that row elements have the same dimention that SELECT list elements in comporison between rows and subqueries added (BUG#8022) 2005-01-24 15:56:57 +02:00
bell@sanja.is.com.ua
76ae5caca0 fixed column number fetchinmg for subqueries. (BUG#8020)
fixed cols() method call (it have to be called only after fix_fields())
2005-01-24 14:25:44 +02:00
sergefp@mysql.com
9a7a47c21c Merge mysql.com:/dbdata/psergey/mysql-4.1-bug7885
into mysql.com:/dbdata/psergey/mysql-5.0-bug7885
2005-01-19 23:11:50 +03:00
sergefp@mysql.com
b1d55200b1 Fix for BUG#7885 2005-01-18 17:26:05 +03: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
serg@sergbook.mysql.com
a04fc26c54 manually merged 2004-12-31 15:26:24 +01:00
igor@rurik.mysql.com
d3fa245363 subselect.result, subselect.test:
Added test cases for bug #7351.
item_cmpfunc.cc:
  Fixed bug #7351: incorrect result for a query with a
  subquery returning empty set.
  If in the predicate v IN (SELECT a FROM t WHERE cond)
  v is null, then the result of the predicate is either
  INKNOWN or FALSE. It is FALSE if the subquery returns
  an empty set.
item_subselect.cc:
  Fixed bug #7351: incorrect result for a query with a
  subquery returning empty set.
  The problem was due to not a quite legal transformation
  for 'IN' subqueries. A subquery containing a predicate
  of the form
  v IN (SELECT a FROM t WHERE cond)
  was transformed into
  EXISTS(SELECT a FROM t WHERE cond AND (a=v OR a IS NULL)).
  Yet, this transformation is valid only if v is not null.
  If v is null, then, in the case when
  (SELECT a FROM t WHERE cond) returns an empty set the value
  of the predicate is FALSE, otherwise the result of the
  predicate is INKNOWN.
  The fix resolves this problem by changing the result
  of the transformation to
  EXISTS(SELECT a FROM t WHERE cond AND (v IS NULL OR (a=v OR a IS NULL)))
  in the case when v is nullable.
  The new transformation prevents applying the lookup
  optimization for IN subqueries. To make it still
  applicable we have to introduce guarded access methods.
2004-12-25 19:17:57 -08:00
monty@mishka.local
4f4bbfc279 Merge with 4.1 2004-12-22 13:54:39 +02:00
sergefp@mysql.com
3c8f48d2e3 * Added comments and one assert
* Backport of safety measures from 5.0: make numeorous replaces:
    s/item->fix_fields()/if (!item->fixed) item->fix_fields()
2004-12-14 03:36:19 +03:00
bell@sanja.is.com.ua
b9abf25a55 new reference which refer to current value not to result used for resolving outer
refernces if subqueri is not in HAVING clause (BUG#7079)
  and the same used for subquery transformetion
2004-12-11 17:13:19 +02:00
konstantin@mysql.com
356005efd7 A fix and test case for Bug#6873 "PS, having with subquery, crash
during execute"
2004-12-09 00:37:17 +03:00
bell@sanja.is.com.ua
acbca25dd2 postreview fix 2004-12-07 21:18:15 +02:00
bell@sanja.is.com.ua
072d38eb12 merge 2004-11-21 20:08:12 +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
bell@sanja.is.com.ua
0ef0b030a5 merge 2004-11-11 21:18:10 +02:00
konstantin@mysql.com
e5f4c7a0bd Rename: Item::val -> Item::val_real(). 2004-11-11 21:39:35 +03: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
bell@sanja.is.com.ua
3ae044c24f removed incorrect error message about aggregate functions
improved mechanisn of detection posibility to be NULL for single row queries
switched off substitution optimisation for single row subqueries in PS due to problem in resolving substituted expressions
(changes to make subselects test working with PS protocol)
2004-10-27 21:11:06 +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
bell@sanja.is.com.ua
4714a6e744 errors without code removed
net_printf/send_error calls replaced by my_error family functions
-1/1 (sent/unsent) error reporting removed
(WL#2133)
2004-10-20 04:04:37 +03:00
bell@sanja.is.com.ua
8db65bd6ae Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-4.1
2004-10-13 23:25:36 +03:00
konstantin@mysql.com
234c80b689 Deployment of centralized Item change registry, step 2: Item_ref
doesn't need to have it's own recovery mechanism.
2004-10-08 19:13:09 +04:00
bell@sanja.is.com.ua
df43a27a96 correct (high level) fix for BUG#5367 to privent problems in other engines 2004-10-07 14:13:42 +03:00
konstantin@mysql.com
e107778119 Comments to the single-select optimization algorithm. 2004-10-04 18:58:06 +04:00
bell@sanja.is.com.ua
f11bcefae1 fixed error handling if creating derived table failed
single row subquery always can return NULL (no rows found) (BUG#5590)
2004-09-17 19:08:46 +03:00
bell@sanja.is.com.ua
f797298fc5 fixed merged view fields names (BUG#5147)
support of merged VIEW over several tables added (WL#1809)
2004-09-14 19:28:29 +03:00
bell@sanja.is.com.ua
a7de21c3e0 thd pointer fixed 2004-09-10 13:09:27 +03:00
bell@sanja.is.com.ua
a23857e071 post merge fixes 2004-09-10 02:22:44 +03:00
monty@mysql.com
f2829d0386 After merge fixes of merge with 4.1 that included the new arena code.
Fixed (together with Guilhem) bugs in mysqlbinlog regarding --offset
Prefix addresses with 0x for easier comparisons of debug logs
Fixed problem where MySQL choosed index-read even if there would be a much better range on the same index
This fix changed some 'index' queries to 'range' queries in the test suite
Don't create 'dummy' WHERE clause for trivial WHERE clauses where we can remove the WHERE clause.
This fix removed of a lot of 'Using where' notes in the test suite.
Give NOTE instead of WARNING if table/function doesn't exists when using DROP IF EXISTS
Give NOTE instead of WARNING for safe field-type conversions
2004-09-09 06:59:26 +03:00
monty@mysql.com
31122efde7 Merge with 4.1
(Includes merge of arena code in 4.1 and 5.0)
2004-09-06 15:14:10 +03:00
bell@sanja.is.com.ua
5d42c492d6 fixed temporary table processing expresions of subqueries and removed wrong restrictions of field resolving (BUG#5326) 2004-09-06 13:00:24 +03:00
monty@mysql.com
46ff90738b Merge with pulled code 2004-09-03 22:38:45 +03:00
monty@mysql.com
cbd67f49e1 Cleanup of new code pushed into 5.0 since last pull
Merged the different find_xxxx_table_in_list functions to one + some inline functions
2004-09-03 21:43:04 +03:00
bell@sanja.is.com.ua
6fcd27e9cd after review fixes:
allowed parsing of table fields inside aggregate functions
 added new tests of fields resolving in grouping
2004-08-23 22:31:01 +03:00
bell@sanja.is.com.ua
3ca433e332 merge 2004-08-23 15:50:59 +03: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
bell@sanja.is.com.ua
0ce931947e skip resolving field in table list if table list is not accessable due to groupping (BUG#4814) 2004-08-13 10:01:30 +03:00
bell@sanja.is.com.ua
d7ae5de89b in case of compound index fill all parts in optimized IN (BUG#4435) 2004-08-12 17:31:23 +03:00
serg@serg.mylan
8d080cbcfa manual merge 2004-07-20 15:34:57 +02:00
bell@sanja.is.com.ua
5eadafe569 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-subs-4.1
2004-07-17 02:13:02 +03:00
bell@sanja.is.com.ua
9336d36cf8 VIEW
two TABLE_LIST copy eliminated
2004-07-16 01:15:55 +03:00
bell@sanja.is.com.ua
3609ab683e stack overflow check added for subqueries processing (BUG#4554) 2004-07-14 23:57:14 +03:00
monty@mysql.com
1e31199995 Merge with 4.1.3-beta 2004-07-07 11:29:39 +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
d3efbb9d3b Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-innodb-4.1
2004-06-24 10:55:48 +03:00
bell@sanja.is.com.ua
2f5c9b7aa5 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-innodb-4.1
2004-06-23 18:58:52 +03:00
serg@serg.mylan
c03addab79 merged 2004-06-23 12:36:07 +02:00
serg@serg.mylan
3f1c4ba745 handler interface cleanups:
more logical table/index_flags
  return  HA_ERR_WRONG_COMMAND instead of abstract methods where appropriate
  max_keys and other limits renamed to max_supported_keys/etc
  max_keys/etc are now wrappers to max_supported_keys/etc 
  ha_index_init/ha_rnd_init/ha_index_end/ha_rnd_end are now wrappers to real {index,rnd}_{init,end} to enforce strict pairing
2004-06-23 12:29:05 +02:00
konstantin@mysql.com
b793142c8f Unused variables removed (many files). 2004-06-21 20:39:19 +04:00
bell@sanja.is.com.ua
98a7b49dc5 do not unlock tables early if we have subquery in HAVING clause (BUG#3984) 2004-06-09 23:32:20 +03:00
pem@mysql.com
71eddc362e Merging 4.1 to 5.0. 2004-05-26 17:04:45 +02:00
bell@sanja.is.com.ua
c7396f8d20 PS and SP made compatible in mechanism used for preparing query for rexecutions (Bug #2266) 2004-05-20 02:02:49 +03:00
bell@sanja.is.com.ua
d2fa79b291 keep old engine & JOIN if we changed subquery Item (Bug #3646) 2004-05-07 23:06:11 +03:00
pem@mysql.com
bf45960eef Merge 4.1 -> 5.0 2004-05-07 18:52:06 +02:00
magnus@neptunus.(none)
50ff8ea369 Formatting changes requested by Monty 2004-04-15 09:17:55 +02:00
pem@mysql.com
dfd59e296e Merge 4.1 -> 5.0. 2004-04-07 19:07:44 +02:00
bell@sanja.is.com.ua
9bd49d489c after review patch
commant for function
2004-03-29 22:40:49 +03:00
bell@sanja.is.com.ua
e0c2ff9df7 merge 2004-03-27 15:59:48 +02:00
bell@sanja.is.com.ua
d095d4753e after review changes 2004-03-20 13:36:26 +02:00
bell@sanja.is.com.ua
2b45b53066 DBUG_ASSERT(fixed == 1); added to val*
small optimisation in signed_literal
2004-03-18 15:14:36 +02:00
bell@sanja.is.com.ua
8035ce40ec DBUG_ASSERT(fixed == 0) added to fix_fields() 2004-03-17 14:26:26 +02:00
bell@sanja.is.com.ua
cd5c30c5dc fix test during merge 2004-03-16 16:30:09 +02:00
bell@sanja.is.com.ua
d2265b6345 merge 2004-03-15 13:16:40 +02:00
bell@sanja.is.com.ua
d3b96b3a6e after merge fix 2004-03-09 14:44:15 +02:00
bell@sanja.is.com.ua
7e48a0f610 merge 2004-03-09 12:52:25 +02:00
hf@deer.(none)
18d722ff93 Merging 2004-03-04 17:52:06 +04:00
bell@sanja.is.com.ua
8a442c4e0d after review fix 2004-02-20 15:37:45 +02:00
bell@sanja.is.com.ua
2d5338ceb0 revision of fix_fields calls in subqueries transformation
after merge fix
2004-02-18 22:14:41 +02:00
bell@sanja.is.com.ua
14b9fa3588 revision of fix_fields() calls (BUG2838) 2004-02-18 01:08:52 +02:00
bell@sanja.is.com.ua
272bd74abb memory leacks in PS with subqueries fixed (adddition to fix of BUG#2462) 2004-02-12 03:10:26 +02:00
bell@sanja.is.com.ua
69e2460bd4 fixed subquery with PS (BUG#2462)
fixed UNION preparation
2004-02-08 20:14:13 +02:00
bell@sanja.is.com.ua
8fdce902f9 avoid null check on fields where NULL is impossible
(BUG#2393)
2004-02-02 02:23:53 +02:00
ram@gw.mysql.r18.ru
6fab168a63 fix for the bug #2419: order by ignores rows.
null_ref_key moved to TABLE_REF.
new null range created if necessary.
2004-01-31 10:04:16 +04:00
hf@deer.(none)
7dda8c102f Merge deer.(none):/home/hf/work/mysql-4.1.clean
into deer.(none):/home/hf/work/mysql-4.1.1676
2004-01-19 21:06:27 +04:00
ram@gw.mysql.r18.ru
e289783cf8 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into gw.mysql.r18.ru:/usr/home/ram/work/4.1.b2182
2004-01-19 13:00:51 +04:00
bell@sanja.is.com.ua
bcbc9ff22f Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-sub-4.1
2004-01-17 11:53:04 +02:00
hf@deer.(none)
bfe134b86f Fix for prepared statements
Here i added Item_*::cleanup() functions,
removed a lot of ~Item_*'s,
added code to restore order_list and group_list
2003-12-30 14:08:19 +04:00
ram@gw.mysql.r18.ru
9dba5a709b Fix for the bug #2198: SELECT INTO OUTFILE (with Sub-Select) Problem.
Proper Item_cache::setup() method.
Code cleanup.
(discussed with sanja)
2003-12-25 18:50:22 +04:00
konstantin@oak.local
d37da004f6 THD::lex now points to THD::main_lex like in 5.0
All tests pass (client_test included)
2003-12-19 20:52:13 +03:00
monty@mysql.com
031390a9a4 Fixes after merge with 4.0
Cleaned up embedded library access and query cache handling
Changed min stack size to 128K (to allow longer MyISAM keys)
Fixed wrong priority for XOR (should be less than NEG to get -1^1 to work)
2003-12-19 16:25:50 +02:00
bell@sanja.is.com.ua
e756a511f8 fixed unlocking tables during subquery execution (BUG#2048) 2003-12-10 22:46:14 +02:00
hf@deer.(none)
dff5b0a75b Fix for #1992
This bug happens when a query, having subselects in the fields list,
needs temporary table.
Item_subselect::get_tmp_table_item isn't implemented and just returns
*this. So the tmp_table_item takes value not from temporary but
from original table.
2003-12-06 23:37:24 +04:00