summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
Commit message (Collapse)AuthorAgeFilesLines
* Fixed portability issue in my_thr_init.c (was added in my last push)monty@mysql.com/narttu.mysql.fi2006-11-301-1/+1
| | | | | | | | | | Fixed compiler warnings (detected by VC++): - Removed not used variables - Added casts - Fixed wrong assignments to bool - Fixed wrong calls with bool arguments - Added missing argument to store(longlong), which caused wrong store method to be called.
* Merge bk@192.168.21.1:mysql-5.0-optholyfoot/hf@mysql.com/deer.(none)2006-11-171-1/+5
|\ | | | | | | into mysql.com:/home/hf/work/mysql-5.0-0mrg
| * Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-optsergefp@mysql.com2006-11-011-1/+3
| |\ | | | | | | | | | into mysql.com:/home/psergey/mysql-5.0-bug8804-r4
| | * BUG#8804: wrong results for NULL IN (SELECT ...)sergefp@mysql.com2006-10-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Evaluate "NULL IN (SELECT ...)" in a special way: Disable pushed-down conditions and their "consequences": = Do full table scans instead of unique_[index_subquery] lookups. = Change appropriate "ref_or_null" accesses to full table scans in subquery's joins. Also cache value of NULL IN (SELECT ...) if the SELECT is not correlated wrt any upper select.
| * | Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-optgkodinov/kgeorge@rakia.gmz2006-10-311-0/+2
| |\ \ | | |/ | |/| | | | into rakia.gmz:/home/kgeorge/mysql/autopush/B21809-5.0-opt
| | * Bug #21809: Error 1356 while selecting from view with grouping though underlyinggkodinov/kgeorge@macbook.gmz2006-10-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | select OK. The SQL parser was using Item::name to transfer user defined function attributes to the user defined function (udf). It was not distinguishing between user defined function call arguments and stored procedure call arguments. Setting Item::name was causing Item_ref::print() method to print the argument as quoted identifiers and caused views that reference aggregate functions as udf call arguments (and rely on Item::print() for the text of the view to store) to throw an undefined identifier error. Overloaded Item_ref::print to print aggregate functions as such when printing the references to aggregate functions taken out of context by split_sum_func2() Fixed the parser to properly detect using AS clause in stored procedure arguments as an error. Fixed printing the arguments of udf call to print properly the udf attribute.
* | | Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtimedlenev@mockturtle.local2006-11-011-1/+5
|\ \ \ | | | | | | | | | | | | into mockturtle.local:/home/dlenev/src/mysql-5.0-hash-2
| * | | Small cleanup in code handling stored routines/table prelocking.dlenev@mockturtle.local2006-11-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use lazy initialization for Query_tables_list::sroutines hash. This step should significantly decrease amount of memory consumed by stored routines as we no longer will allocate chunk of memory required for this HASH for each statement in routine.
* | | | Merge bk-internal.mysql.com:/home/bk/mysql-5.0kostja@bodhi.local2006-10-231-1/+2
|\ \ \ \ | |/ / / |/| / / | |/ / into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
| * | Fixed bug #19579: at range analysis optimizer did not take into igor@rurik.mysql.com2006-10-161-1/+2
| |/ | | | | | | | | | | | | | | | | account predicates that become sargable after reading const tables. In some cases this resulted in choosing non-optimal execution plans. Now info of such potentially saragable predicates is saved in an array and after reading const tables we check whether this predicates has become saragable.
* | Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0kroki/tomash@moonlight.intranet2006-10-121-1/+20
|\ \ | |/ |/| | | into moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug20953
| * BUG#20953: create proc with a create view that uses local vars/paramskroki/tomash@moonlight.intranet2006-10-121-1/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | should fail to create The problem was that this type of errors was checked during view creation, which doesn't happen when CREATE VIEW is a statement of a created stored routine. The solution is to perform the checks at parse time. The idea of the fix is that the parser checks if a construction just parsed is allowed in current circumstances by testing certain flags, and this flags are reset for VIEWs. The side effect of this change is that if the user already have such bogus routines, it will now get a error when trying to do SHOW CREATE PROCEDURE proc; (and some other) and when trying to execute such routine he will get ERROR 1457 (HY000): Failed to load routine test.p5. The table mysql.proc is missing, corrupt, or contains bad data (internal code -6) However there should be very few such users (if any), and they may (and should) drop these bogus routines.
* | Merge bk-internal:/home/bk/mysql-5.0-optgkodinov@dl145s.mysql.com2006-09-181-1/+1
|\ \ | | | | | | | | | into dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
| * | Fixed bug #21493: crash for the second execution of a functionigor@rurik.mysql.com2006-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | containing a select statement that uses an aggregating IN subquery. Added a parameter to the function fix_prepare_information to restore correctly the having clause for the second execution. Saved andor structure of the having conditions at the proper moment before any calls of split_sum_func2 that could modify the having structure adding new Item_ref objects. (These additions, are produced not with the statement mem_root, but rather with the execution mem_root.)
* | | Merge bk-internal:/home/bk/mysql-5.0-optmsvensson@neptunus.(none)2006-09-041-1/+7
|\ \ \ | |/ / | | | | | | into neptunus.(none):/home/msvensson/mysql/mysql-5.0
| * | BUG#21477 "memory overruns for certain kinds of subqueries":sergefp@mysql.com2006-09-011-1/+7
| | | | | | | | | | | | | | | | | | make st_select_lex::setup_ref_array() take into account that Item_sum-descendant objects located within descendant SELECTs may be added into ref_pointer_array.
* | | Merge maint2.mysql.com:/data/localhome/tsmith/bk/41tsmith@maint2.mysql.com2006-09-011-1/+1
|\ \ \ | |/ / |/| | | | | into maint2.mysql.com:/data/localhome/tsmith/bk/50
| * | Fix for bug #20695: Charset introducer overrides charset definition for column.ramil/ram@mysql.com/myoffice.izhnet.ru2006-08-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | - if there are two character set definitions in the column declaration, we replace the first one with the second one as we store both in the LEX->charset slot. Add a separate slot to the LEX structure to store underscore charset. - convert default values to the column charset of STRING, VARSTRING fields if necessary as well.
| * | Fixed bug #14927.igor@rurik.mysql.com2006-05-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A query with a group by and having clauses could return a wrong result set if the having condition contained a constant conjunct evaluated to FALSE. It happened because the pushdown condition for table with grouping columns lost its constant conjuncts. Pushdown conditions are always built by the function make_cond_for_table that ignores constant conjuncts. This is apparently not correct when constant false conjuncts are present.
* | | Merge sunlight.local:/home/evgen/bk-trees/mysql-5.0evgen@sunlight.local2006-08-091-1/+1
|\ \ \ | | | | | | | | | | | | into sunlight.local:/local_work/leak_fix
| * | | sql_base.cc, unireg.h, sql_lex.h, table.cc, sql_view.h, sql_view.cc:evgen@sunlight.local2006-08-091-1/+1
| | | | | | | | | | | | | | | | Correct memory leak fix
* | | | Merge bk-internal.mysql.com:/home/bk/mysql-5.0kostja@bodhi.local2006-08-021-1/+1
|\ \ \ \ | |/ / / | | | | | | | | into bodhi.local:/opt/local/work/mysql-5.0-runtime-merge
| * | | Bug #21080: ALTER VIEW makes user restate SQL SECURITY mode, and ALGORITHMgkodinov/kgeorge@macbook.gmz2006-07-311-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | When executing ALTER TABLE all the attributes of the view were overwritten. This is contrary to the user's expectations. So some of the view attributes are preserved now : namely security and algorithm. This means that if they are not specified in ALTER VIEW their values are preserved from CREATE VIEW instead of being defaulted.
* | | Fix for BUG#20438: CREATE statements for views, stored routines and triggersanozdrin/alik@booka.2006-07-281-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | can be not replicable. Now CREATE statements for writing in the binlog are created as follows: - the beginning of the statement is re-created; - the rest of the statement is copied from the original query. The problem appears when there is a version-specific comment (produced by mysqldump), started in the re-created part of the statement and closed in the copied part -- there is closing comment-parenthesis, but there is no opening one. The proper fix could be to re-create original statement, but we can not implement it in 5.0. So, for 5.0 the fix is just to cut closing comment-parenthesis. This technique is also used for SHOW CREATE PROCEDURE statement (so we are able to reuse existing code).
* | auxilliary -> auxiliarykonstantin@mysql.com2006-07-041-1/+1
| |
* | Remove a couple of unused/barely used names.konstantin@mysql.com2006-07-011-3/+0
| |
* | Bug#17203: "sql_no_cache sql_cache" in views created from prepared statementkroki@mysql.com2006-06-271-0/+8
| | | | | | | | | | | | | | | | The problem was that we restored SQL_CACHE, SQL_NO_CACHE flags in SELECT statement from internal structures based on value set later at runtime, not the original value set by the user. The solution is to remember that original value.
* | Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtimekonstantin@mysql.com2006-06-271-0/+5
|\ \ | | | | | | | | | into mysql.com:/opt/local/work/mysql-5.0-17199
| * | A fix and a test case forkonstantin@mysql.com2006-06-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#19022 "Memory bug when switching db during trigger execution" Bug#17199 "Problem when view calls function from another database." Bug#18444 "Fully qualified stored function names don't work correctly in SELECT statements" Documentation note: this patch introduces a change in behaviour of prepared statements. This patch adds a few new invariants with regard to how THD::db should be used. These invariants should be preserved in future: - one should never refer to THD::db by pointer and always make a deep copy (strmake, strdup) - one should never compare two databases by pointer, but use strncmp or my_strncasecmp - TABLE_LIST object table->db should be always initialized in the parser or by creator of the object. For prepared statements it means that if the current database is changed after a statement is prepared, the database that was current at prepare remains active. This also means that you can not prepare a statement that implicitly refers to the current database if the latter is not set. This is not documented, and therefore needs documentation. This is NOT a change in behavior for almost all SQL statements except: - ALTER TABLE t1 RENAME t2 - OPTIMIZE TABLE t1 - ANALYZE TABLE t1 - TRUNCATE TABLE t1 -- until this patch t1 or t2 could be evaluated at the first execution of prepared statement. CURRENT_DATABASE() still works OK and is evaluated at every execution of prepared statement. Note, that in stored routines this is not an issue as the default database is the database of the stored procedure and "use" statement is prohibited in stored routines. This patch makes obsolete the use of check_db_used (it was never used in the old code too) and all other places that check for table->db and assign it from THD::db if it's NULL, except the parser. How this patch was created: THD::{db,db_length} were replaced with a LEX_STRING, THD::db. All the places that refer to THD::{db,db_length} were manually checked and: - if the place uses thd->db by pointer, it was fixed to make a deep copy - if a place compared two db pointers, it was fixed to compare them by value (via strcmp/my_strcasecmp, whatever was approproate) Then this intermediate patch was used to write a smaller patch that does the same thing but without a rename. TODO in 5.1: - remove check_db_used - deploy THD::set_db in mysql_change_db See also comments to individual files.
* | | Manually mergedevgen@moonbone.local2006-06-171-0/+2
|\ \ \ | |/ / |/| |
| * | Fixed bug#19789: REPLACE was allowed for a VIEW with CHECK OPTION enabled.evgen@moonbone.local2006-06-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The st_lex::which_check_option_applicable() function controls for which statements WITH CHECK OPTION clause should be taken into account. REPLACE and REPLACE_SELECT wasn't in the list which results in allowing REPLACE to insert wrong rows in a such view. The st_lex::which_check_option_applicable() now includes REPLACE and REPLACE_SELECT in the list of statements for which WITH CHECK OPTION clause is applicable.
* | | Bug#17204 "second CALL to procedure crashes Server"gluh@eagle.intranet.mysql.r18.ru2006-05-301-59/+92
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug#18282 "INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views" This bug caused crashes or resulted in wrong data being returned when one tried to obtain information from I_S tables about views using stored functions. It was caused by the fact that we were using LEX representing statement which were doing select from I_S tables as active LEX when contents of I_S table were built. So state of this LEX both affected and was affected by open_tables() calls which happened during this process. This resulted in wrong behavior and in violations of some of invariants which caused crashes. This fix tries to solve this problem by properly saving/resetting and restoring part of LEX which affects and is affected by the process of opening tables and views in get_all_tables() routine. To simplify things we separated this part of LEX in a new class and made LEX its descendant.
* | Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0igor@rurik.mysql.com2006-04-211-0/+1
|\ \ | |/ | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
| * Fixed bug #18767.igor@rurik.mysql.com2006-04-201-0/+1
| | | | | | | | | | | | | | The bug caused wrong result sets for union constructs of the form (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2. For such queries order lists were concatenated and limit clause was completely neglected.
* | This patch does 1) fix my build breakage 2) Complete the removal of all ↵brian@zim.(none)2006-03-091-2/+2
| | | | | | | | symbols which could clash with another parser.
* | Porting fix that allows others to include compiled code with different parsers. brian@zim.(none)2006-03-091-0/+4
| | | | | | | | Makes you wonder what I am up to, doesn't?
* | Implementation of WL#2897: Complete definer support in the stored routines.anozdrin@mysql.com2006-03-021-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea is to add DEFINER-clause in CREATE PROCEDURE and CREATE FUNCTION statements. Almost all support of definer in stored routines had been already done before this patch. NOTE: this patch changes behaviour of dumping stored routines in mysqldump. Before this patch, mysqldump did not dump DEFINER-clause for stored routines and this was documented behaviour. In order to get full information about stored routines, one should have dumped mysql.proc table. This patch changes this behaviour, so that DEFINER-clause is dumped. Since DEFINER-clause is not supported in CREATE PROCEDURE | FUNCTION statements before this patch, the clause is covered by additional version-specific comments.
* | Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0igor@rurik.mysql.com2006-02-021-0/+1
|\ \ | | | | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-0
| * | FIxed bug #14927.igor@rurik.mysql.com2006-01-311-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | A query with a group by and having clauses could return a wrong result set if the having condition contained a constant conjunct evaluated to FALSE. It happened because the pushdown condition for table with grouping columns lost its constant conjuncts. Pushdown conditions are always built by the function make_cond_for_table that ignores constant conjuncts. This is apparently not correct when constant false conjuncts are present.
* | Merge rurik.mysql.com:/home/igor/mysql-5.0igor@rurik.mysql.com2005-12-101-2/+2
|\ \ | | | | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
| * \ Merge mysql.com:/home/timka/mysql/src/5.0-virgintimour@mysql.com2005-12-061-2/+2
| |\ \ | | | | | | | | | | | | into mysql.com:/home/timka/mysql/src/5.0-2486
| | * | WL#2486 - Natural/using join according to SQL:2003.timour@mysql.com2005-11-281-2/+2
| | | | | | | | | | | | | | | | Post-review fixes according to Monty's review.
* | | | Merge rurik.mysql.com:/home/igor/mysql-5.0igor@rurik.mysql.com2005-12-021-2/+2
|\ \ \ \ | |/ / / | | | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
| * | | Now we shall store only position (index of first character)bell@sanja.is.com.ua2005-12-021-2/+2
| |/ / | | | | | | | | | | | | | | | | | | of SELECT from query begining, to be independet of query buffer allocation. Correct procedure used to find beginning of the current statement during parsing (BUG#14885).
* | | Merge rurik.mysql.com:/home/igor/mysql-5.0igor@rurik.mysql.com2005-11-221-0/+1
|\ \ \ | |/ / | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
| * | Background:pem@mysql.com2005-11-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since long, the compiled code of stored routines has been printed in the trace file when starting mysqld with the "--debug" flag. (At creation time only, and only in debug builds of course.) This has been helpful when debugging stored procedure execution, but it's a bit awkward to use. Also, the printing of some of the instructions is a bit terse, in particular for sp_instr_stmt where only the command code was printed. This improves the printout of several of the instructions, and adds the debugging- only commands "show procedure code <name>" and "show function code <name>". (In non-debug builds they are not available.)
* | | Merge rurik.mysql.com:/home/igor/mysql-5.0igor@rurik.mysql.com2005-11-131-0/+14
|\ \ \ | |/ / |/| | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
| * | Merge rurik.mysql.com:/home/igor/mysql-5.0igor@rurik.mysql.com2005-11-041-0/+14
| |\ \ | | | | | | | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
| | * \ Merge rurik.mysql.com:/home/igor/mysql-5.0igor@rurik.mysql.com2005-10-291-0/+14
| | |\ \ | | | | | | | | | | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-2
| | | * \ Merge rurik.mysql.com:/home/igor/mysql-5.0igor@rurik.mysql.com2005-10-271-0/+14
| | | |\ \ | | | | | | | | | | | | | | | | | | into rurik.mysql.com:/home/igor/dev/mysql-5.0-2