Commit graph

1272 commits

Author SHA1 Message Date
aivanov@mysql.com
2165167200 Merge mysql.com:/home/alexi/dev/mysql-4.1-0
into  mysql.com:/home/alexi/dev/mysql-5.0-0
2005-09-06 23:49:54 +04:00
aivanov@mysql.com
fa51afedeb item_cmpfunc.h:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   The classes Item_func_between, Item_func_if, Item_func_in are modified.
   Item_func_between/in objects can represent now [NOT]BETWEEN/IN expressions.
   The class Item_func_opt_neg is added to factor out the functionality
   common for the modified classes Item_func_between and Item_func_in.
item_cmpfunc.cc:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   Added Item_func_between::fix_fields(), Item_func_if::fix_fields(),
   Item_func_in::fix_fields(). They correct generic calculation of
   the not_null_tables attribute when it is needed.
   Modified Item_func_between::val_int(), Item_func_in::val_int().
opt_range.cc:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   The function get_mm_tree() is modified. There cannot be NOT before
   BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
   now [NOT]BETWEEN/IN expressions.
sql_yacc.yy:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   Item_func_between/in objects can represent now [NOT]BETWEEN/IN expresions.
join_outer.result:
  Fixed some testcases results (bugs #12101, #12102)
join_outer.test:
  Added testcases for bugs #12101, #12102
2005-09-06 18:03:08 +04:00
konstantin@mysql.com
38486e83c1 Implement WL#2661 "Prepared Statements: Dynamic SQL in Stored Procedures".
The idea of the patch is to separate statement processing logic,
such as parsing, validation of the parsed tree, execution and cleanup, 
from global query processing logic, such as logging, resetting
priorities of a thread, resetting stored procedure cache, resetting
thread count of errors and warnings.
This makes PREPARE and EXECUTE behave similarly to the rest of SQL
statements and allows their use in stored procedures.
This patch contains a change in behaviour:
until recently for each SQL prepared statement command, 2 queries
were written to the general log, e.g.
[Query]   prepare stmt from @stmt_text;
[Prepare] select * from t1 <-- contents of @stmt_text
The chagne was necessary to prevent [Prepare] commands from being written
to the general log when executing a stored procedure with Dynamic SQL.
We should consider whether the old behavior is preferrable and probably
restore it.
This patch refixes Bug#7115, Bug#10975 (partially), Bug#10605 (various bugs
in Dynamic SQL reported before it was disabled).
2005-09-03 03:13:18 +04:00
ingo@mysql.com
4b0ac126cd Merge mysql.com:/home/mydev/mysql-5.0
into  mysql.com:/home/mydev/mysql-5.0-5000
2005-08-29 21:11:05 +02:00
ingo@mysql.com
5845a6e553 Bug#10056 - PACK_KEYS option take values greater than 1 while creating table
Added a switch to reject illegal values for PACK_KEYS.
2005-08-29 17:24:07 +02:00
andrey@lmy004.
d7d307fbdd Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-5.0
into lmy004.:/work/mysql-5.0-ready4
2005-08-29 12:20:36 +02:00
andrey@lmy004.
ed0bac2116 fix for bug #12490 (all-in-one patch)
(Packets out of order if calling HELP CONTENTS from Stored Procedure)
2005-08-29 12:19:08 +02:00
hf@deer.(none)
23a51871d2 Merge deer.(none):/home/hf/work/mysql-5.0.11207
into deer.(none):/home/hf/work/mysql-5.0.clean
2005-08-27 18:53:54 +05:00
hf@deer.(none)
b2a1a5e7f2 Addition to the fix for #11207 (SET GLOBAL TRANSACTION ISOLATION LEVEL) 2005-08-27 18:51:11 +05:00
hf@deer.(none)
63d6bc34e0 Merge deer.(none):/home/hf/work/mysql-5.0.10499
into deer.(none):/home/hf/work/mysql-5.0.clean
2005-08-27 18:13:26 +05:00
acurtis@xiphis.org
23c19b21d6 Bug#9048
"Creating a function with char binary IN parameter fails"
  Parse BINARY as part of type declaration, not as 
  a column attribute.
2005-08-27 07:26:14 +01:00
sergefp@mysql.com
c78ce16681 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-bug12335-release2
2005-08-25 17:39:02 +04:00
sergefp@mysql.com
95c3afc5d9 Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs.
"Interleaved SPs execution is now binlogged properly, "SELECT spfunc()" is binlogged too.
The known remaining issue is binlogging/replication of "a routine is deleted while it is executed" scenario.
2005-08-25 17:34:34 +04:00
jimw@mysql.com
9e4a9e23c6 Make SYSDATE() behave as in Oracle: always the current datetime, not the
datetime of when the current statement began. This also makes SYSDATE()
not safe in replication. (Bug #12562)
2005-08-24 15:50:58 -07:00
serg@sergbook.mysql.com
117d61c8a0 Merge bk-internal:/home/bk/mysql-5.0
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0
2005-08-20 14:38:18 +04:00
serg@sergbook.mysql.com
c234386a40 the syntax is XA END xid [SUSPEND [FOR MIGRATE]] 2005-08-19 18:00:16 +04:00
monty@mysql.com
3eaa953529 Cleanups and optimization during review of new code 2005-08-18 03:12:42 +03: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
monty@mysql.com
df32f7d621 Save and clear run context before executing a stored function or trigger and restore it afterwards.
This allows us to use statement replication with functions and triggers
The following things are fixed with this patch:
- NOW() and automatic timestamps takes the value from the main event for functions and triggers (which allows these to replicate with statement level logging)
- No side effects for triggers or functions with auto-increment values(), last_insert_id(), rand() or found_rows()
- Triggers can't return result sets

Fixes bugs:
#12480: NOW() is not constant in a trigger
#12481: Using NOW() in a stored function breaks statement based replication
#12482: Triggers has side effects with auto_increment values
#11587: trigger causes lost connection error
2005-08-15 18:15:12 +03: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
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
hf@deer.(none)
a99c04b2db Fix for bug #10499 (Function creation with GEOMETRY return) 2005-08-10 13:45:05 +05:00
dlenev@mysql.com
51537c057d Fix for bug #12280 "Triggers: crash if flush tables".
We should not allow FLUSH statement to be executed inside both triggers
and stored functions.
2005-08-10 10:31:32 +04:00
hf@deer.(none)
9c78cdffbd Fix for bug #11207 (SET GLOBAL TRANSACTION ISOLATION LEVEL is broken) 2005-08-08 19:04:10 +05:00
dlenev@mysql.com
b141437ad3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-tn
2005-07-19 20:55:09 +04:00
dlenev@mysql.com
8a3e723b74 Fix for bugs #5892/6182/8751/8758/10994 (based on Antony's patch)
"Triggers have the wrong namespace"
  "Triggers: duplicate names allowed"
  "Triggers: CREATE TRIGGER does not accept fully qualified names"
  "SHOW TRIGGERS"
2005-07-19 20:06:49 +04:00
konstantin@mysql.com
52b8928b09 Merge mysql.com:/home/kostja/mysql/mysql-4.1-root
into  mysql.com:/home/kostja/mysql/mysql-5.0-merge
2005-07-19 00:55:37 +04:00
monty@mishka.local
2278e0319c Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mishka.local:/home/my/mysql-5.0
2005-07-18 19:03:01 +03:00
monty@mishka.local
78c65b5adc Cleanups during review
Changed defaults option --instance to --defaults-group-suffix
Changed option handling to allow --defaults-file, --defaults-extra-file and --defaults-group-suffix to be given in any order
Changed MYSQL_INSTANCE to MYSQL_GROUP_SUFFIX
mysql_print_defaults now understands --defaults-group-suffix
Remove usage of my_tempnam() (not safe function)
if( -> if ( and while( to while (
2005-07-18 15:33:18 +03:00
igor@rurik.mysql.com
54dd7e5ebf select.result, select.test:
Added a test case for bug #11745.
sql_select.cc:
  Fixed bug # 11745.
  Added support of where clause for queries with FROM DUAL.
sql_yacc.yy:
  Fixed bug # 11745.
  Added optional where clause for queries with FROM DUAL.
2005-07-17 09:46:14 -07:00
igor@rurik.mysql.com
bff3507b1d func_in.result, func_in.test:
Fixed bug #11885.
sql_select.cc:
  Fixed bug #11885.
  Predicates of the forms 'a IN (v)' 'a NOT IN (v)' now
  is replaced by 'a=v' and 'a<>v' at the parsing stage.
sql_yacc.yy:
  Fixed bug #11885.
  Predicates of the forms 'a IN (v)' 'a NOT IN (v)' now 
  is replaced by 'a=v' and 'a<>v' at the parsing stage.
2005-07-16 18:06:34 -07: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
3274b050bc Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/opt/local/work/mysql-5.0-root
2005-07-15 00:31:09 +04:00
konstantin@mysql.com
a2b11ff266 A fix and a test case for Bug#11299 "prepared statement makes wrong SQL
syntax in binlog which stops replication":
disallow the use of parameter markers which can lead to generation
of malformed binlog queries.
2005-07-15 00:01:49 +04:00
pem@mysql.com
ee81c73a0d Post-review fix. 2005-07-11 19:10:51 +02:00
pem@mysql.com
6f54e27e5e Merge mysql.com:/usr/local/bk/mysql-5.0
into  mysql.com:/home/pem/work/mysql-5.0
2005-07-11 12:46:42 +02:00
dlenev@mysql.com
75b8d4fa08 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg8406
2005-07-09 22:04:18 +04:00
dlenev@mysql.com
923fe817e0 Enable support of access to tables from triggers. Thus fix bug #8406 "Triggers
crash if referencing a table" and several other related bugs.
Fix for bug #11834 "Re-execution of prepared statement with dropped function
crashes server." which was spotted during work on previous bugs.

Also couple of nice cleanups:
- Replaced two separate hashes for stored routines used by statement with one.
- Now instead of doing one pass through all routines used in statement for
  caching them and then doing another pass for adding their tables to table
  list, we do only one pass during which do both things.
2005-07-09 21:51:59 +04:00
pem@mysql.com
312ea035ba Merge mysql.com:/usr/local/bk/mysql-5.0
into  mysql.com:/home/pem/work/mysql-5.0
2005-07-07 09:13:49 +02: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
pem@mysql.com
18d6dd56ef Fixed BUG#7088: Stored procedures: labels won't work if character set is utf8.
We used 'IDENT' for labels as a temporary fix for the  parser conflicts
  introduced if the proper rule 'ident' was used. Now a specially tailored
  'label_ident' rule is used for labels instead.
2005-07-06 16:37:57 +02:00
monty@mysql.com
86d7b02199 Merge with 4.1 2005-07-03 14:17:52 +03:00
pem@mysql.com
481bb717d7 Disabled the GOTO feature. (It's non-standard and undocumented.)
We want to have the defacto standard syntax for labels ("L:" instead of "label L;"),
and fix some known bugs, before we enable this again.
The code is left intact (#ifdef'ed SP_GOTO) and the test cases are kept in
sp-goto.test, for the future...
2005-07-01 15:25:51 +02:00
bell@sanja.is.com.ua
faebc3148f fix bugs found by gcc 3.4 compiler 2005-07-01 13:27:23 +03:00
bell@sanja.is.com.ua
d3905f3d0e Name resolution context added (BUG#6443) 2005-07-01 07:05:42 +03:00
monty@mishka.local
83f90e060e Better bug fix for:
#9728  'Decreased functionality in "on duplicate key update
#8147  'a column proclaimed ambigous in INSERT ... SELECT .. ON DUPLICATE'

This ensures fields are uniquely qualified and also that one can't update other tables in the ON DUPLICATE KEY UPDATE part
2005-06-27 16:46:41 +03:00
evgen@moonbone.local
5c8e3341d3 Bug #9728 fix merge 2005-06-23 01:02:43 +04:00
evgen@moonbone.local
2235ea9593 Fix bug #9728 decreased functionality in "on duplicate key update"
Remove changes made by bug fix #8147. They strips list of insert_table_list to
only insert table, which results in error reported in bug #9728.
Added flag to Item to resolve ambigous fields reported in bug #8147.
2005-06-22 07:18:42 +04:00