From 5b2a810e5d857856971dcd0e9f88ec1a397486d2 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Feb 2003 22:26:09 +0200 Subject: fixed SQL_SELECT option with UNIONs mysql-test/r/query_cache.result: test of SQL_CACHE with UNIONs mysql-test/t/query_cache.test: test of SQL_CACHE with UNIONs --- sql/sql_yacc.yy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sql/sql_yacc.yy') diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 2f339f30eb4..0879995e733 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1530,7 +1530,10 @@ select_option: Select->options|= OPTION_FOUND_ROWS; } | SQL_NO_CACHE_SYM { current_thd->safe_to_cache_query=0; } - | SQL_CACHE_SYM { Select->options|= OPTION_TO_QUERY_CACHE; } + | SQL_CACHE_SYM + { + Lex->select_lex.options|= OPTION_TO_QUERY_CACHE; + } | ALL {} ; -- cgit v1.2.1 From 62af18cb8729894625d005e260838f68b7c57175 Mon Sep 17 00:00:00 2001 From: unknown Date: Sat, 26 Apr 2003 20:43:28 +0300 Subject: Fix for -fbranch-probabilites (bug 268) Fix for LEFT/RIGHT/MID with multi-byte-character sets (bug 314) Fix for new bison 1.875 max_insert_delayed_threads and delayed_insert_timeout now works as documented (bug 211) Don't show port in SHOW PROCESSLIST for system threads Fix problem with ORDER BY being discarded for some DISTINCT queries (bug 275) Fixed bug with NATURAL LEFT JOIN, NATURAL RIGHT JOIN and RIGHT JOIN when using many joined tables (Bug 212) acinclude.m4: Fix for -fbranch-probabilites configure.in: Fix for -fbranch-probabilites myisam/mi_open.c: Give error instead of writing to stderr (Which user can't see) mysql-test/r/join.result: Update results after change to NATURAL/LEFT/RIGHT JOIN mysql-test/r/join_outer.result: Update results after change to NATURAL/LEFT/RIGHT JOIN mysql-test/r/select.result: Update results after change to NATURAL/LEFT/RIGHT JOIN mysql-test/t/join.test: Update results after change to NATURAL/LEFT/RIGHT JOIN sql/item_strfunc.cc: Fix for LEFT/RIGHT/MID with multi-byte-character sets sql/mysqld.cc: Fix for new bison 1.875 (Wrong error text message when one got syntax error) sql/sql_class.cc: Don't show port in SHOW PROCESSLIST for system threads sql/sql_insert.cc: max_insert_delayed_threads now works as documented. delayed_insert_timeout now works on Linux sql/sql_parse.cc: Added comment sql/sql_select.cc: Fix problem with ORDER BY being discarded and results returned un-sorted sql/sql_yacc.yy: Fixed bug with NATURAL LEFT JOIN, NATURAL RIGHT JOIN and RIGHT JOIN when using many joined tables. --- sql/sql_yacc.yy | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'sql/sql_yacc.yy') diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 7cd0b9406ea..d7a0c15e9b9 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -492,12 +492,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %right NOT %right BINARY -/* These don't actually affect the way the query is really evaluated, but - they silence a few warnings for shift/reduce conflicts. */ -%left ',' -%left STRAIGHT_JOIN JOIN_SYM -%nonassoc CROSS INNER_SYM NATURAL LEFT RIGHT - %type IDENT TEXT_STRING REAL_NUM FLOAT_NUM NUM LONG_NUM HEX_NUM LEX_HOSTNAME ULONGLONG_NUM field_ident select_alias ident ident_or_text @@ -2116,7 +2110,7 @@ join_table_list: | join_table_list ',' join_table_list { $$=$3; } | join_table_list normal_join join_table_list { $$=$3; } | join_table_list STRAIGHT_JOIN join_table_list - { $$=$3 ; $$->straight=1; } + { $$=$3 ; $1->next->straight=1; } | join_table_list normal_join join_table_list ON expr { add_join_on($3,$5); $$=$3; } | join_table_list normal_join join_table_list @@ -2140,9 +2134,13 @@ join_table_list: USING '(' using_list ')' { add_join_on($5,$9); $5->outer_join|=JOIN_TYPE_LEFT; $$=$5; } | join_table_list NATURAL LEFT opt_outer JOIN_SYM join_table_list - { add_join_natural($1,$6); $6->outer_join|=JOIN_TYPE_LEFT; $$=$6; } + { + add_join_natural($1,$1->next); + $1->next->outer_join|=JOIN_TYPE_LEFT; + $$=$6; + } | join_table_list RIGHT opt_outer JOIN_SYM join_table_list ON expr - { add_join_on($1,$7); $1->outer_join|=JOIN_TYPE_RIGHT; $$=$1; } + { add_join_on($1,$7); $1->outer_join|=JOIN_TYPE_RIGHT; $$=$5; } | join_table_list RIGHT opt_outer JOIN_SYM join_table_list { SELECT_LEX *sel=Select; @@ -2150,11 +2148,15 @@ join_table_list: sel->db2=$5->db; sel->table2=$5->alias; } USING '(' using_list ')' - { add_join_on($1,$9); $1->outer_join|=JOIN_TYPE_RIGHT; $$=$1; } + { add_join_on($1,$9); $1->outer_join|=JOIN_TYPE_RIGHT; $$=$5; } | join_table_list NATURAL RIGHT opt_outer JOIN_SYM join_table_list - { add_join_natural($6,$1); $1->outer_join|=JOIN_TYPE_RIGHT; $$=$1; } + { + add_join_natural($1->next,$1); + $1->outer_join|=JOIN_TYPE_RIGHT; + $$=$6; + } | join_table_list NATURAL JOIN_SYM join_table_list - { add_join_natural($1,$4); $$=$4; }; + { add_join_natural($1,$1->next); $$=$4; }; normal_join: JOIN_SYM {} -- cgit v1.2.1 From f22be777341f53b4deb58851828c0733ab5380bf Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 27 Apr 2003 22:12:08 +0300 Subject: Fixed problem when comparing a key for a multi-byte-character set. (bug 152) Use 0x.... as strings if 'new' mode. (bug 152) Don't report -max on windows when InnoDB is enabled. (bug 332) Reset current_linfo; This could cause a hang when doing PURGE LOGS. Fix for row numbers in EXPLAIN (bug 322) Fix that USE_FRM works for all table types (bug 97) VC++Files/libmysql/libmysql.dsp: Added new source files myisam/mi_key.c: Fixed problem when comparing a key for a multi-byte-character set. myisam/mi_range.c: Fixed problem when comparing a key for a multi-byte-character set. myisam/mi_rkey.c: Fixed problem when comparing a key for a multi-byte-character set. myisam/mi_search.c: Fixed problem when comparing a key for a multi-byte-character set. myisam/mi_test2.c: Fixed printf statements myisam/myisamdef.h: Fixed problem when comparing a key for a multi-byte-character set. myisam/sort.c: Fixed printf statements mysql-test/r/ctype_latin1_de.result: New test results mysql-test/r/join.result: New test results mysql-test/r/repair.result: New test results mysql-test/r/rpl_alter.result: New test results mysql-test/t/ctype_latin1_de-master.opt: --new is needed to get 0x... strings to work properly mysql-test/t/ctype_latin1_de.test: New test for latin1_de mysql-test/t/repair.test: Test of USE_FRM and HEAP tables sql/field.cc: Fixed problem when comparing a key for a multi-byte-character set. sql/item.cc: Use 0x.... as strings if 'new' mode sql/item.h: Use 0x.... as strings if 'new' mode sql/mysqld.cc: Don't report -max on windows when InnoDB is enabled. sql/sql_analyse.cc: Removed unused variable sql/sql_insert.cc: Removed debug message sql/sql_repl.cc: Reset current_linfo; This could cause a hang when doing PURGE LOGS. sql/sql_select.cc: Fix for row numbers in EXPLAIN sql/sql_table.cc: Fix that USE_FRM works for all table types (without strange errors) sql/sql_yacc.yy: Removed compiler warnings. --- sql/sql_yacc.yy | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'sql/sql_yacc.yy') diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index d7a0c15e9b9..f895c809366 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2310,16 +2310,12 @@ olap_opt: | WITH CUBE_SYM { LEX *lex=Lex; - lex->olap = true; - lex->select->olap= CUBE_TYPE; net_printf(&lex->thd->net, ER_NOT_SUPPORTED_YET, "CUBE"); YYABORT; /* To be deleted in 4.1 */ } | WITH ROLLUP_SYM { LEX *lex=Lex; - lex->olap = true; - lex->select->olap= ROLLUP_TYPE; net_printf(&lex->thd->net, ER_NOT_SUPPORTED_YET, "ROLLUP"); YYABORT; /* To be deleted in 4.1 */ } @@ -2407,7 +2403,7 @@ delete_limit_clause: ULONG_NUM: NUM { $$= strtoul($1.str,NULL,10); } - | LONG_NUM { $$= (ulonglong) strtoll($1.str,NULL,10); } + | LONG_NUM { $$= (ulong) strtoll($1.str,NULL,10); } | ULONGLONG_NUM { $$= (ulong) strtoull($1.str,NULL,10); } | REAL_NUM { $$= strtoul($1.str,NULL,10); } | FLOAT_NUM { $$= strtoul($1.str,NULL,10); }; -- cgit v1.2.1 From 10c790eff016ff0fc779baeb7ebf94940d3544e7 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 13 May 2003 10:54:07 +0300 Subject: Safety fix to enable RAID in max binaries Better fix for format('nan') Fix for HAVING COUNT(DISTINCT...) myisam/mi_check.c: Better error message myisam/mi_dynrec.c: Simple code cleanup myisam/myisamchk.c: Better error messages mysql-test/r/func_misc.result: Added back test for format('nan') mysql-test/r/having.result: New test mysql-test/t/func_misc.test: Added back test for format('nan') mysql-test/t/having.test: Added test for count(distinct) in having mysys/raid.cc: Safety fix to enable RAID in max binaries scripts/mysql_install_db.sh: Create data directories even if --in-rpm is used (for MaxOSX) sql/item_strfunc.cc: Better fix for format('nan') sql/mysqld.cc: Give stacktrace on assert() sql/sql_yacc.yy: Fix for HAVING COUNT(DISTINCT...) tests/big_record.pl: Extend test to abuse packed MyISAM tables tests/table_types.pl: Fixed wrong merge --- sql/sql_yacc.yy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sql/sql_yacc.yy') diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index f895c809366..340fbc1b3dc 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -2017,8 +2017,12 @@ sum_expr: { $$=new Item_sum_count(new Item_int((int32) 0L,1)); } | COUNT_SYM '(' in_sum_expr ')' { $$=new Item_sum_count($3); } - | COUNT_SYM '(' DISTINCT expr_list ')' - { $$=new Item_sum_count_distinct(* $4); } + | COUNT_SYM '(' DISTINCT + { Select->in_sum_expr++; } + expr_list + { Select->in_sum_expr--; } + ')' + { $$=new Item_sum_count_distinct(* $5); } | GROUP_UNIQUE_USERS '(' text_literal ',' NUM ',' NUM ',' in_sum_expr ')' { $$= new Item_sum_unique_users($3,atoi($5.str),atoi($7.str),$9); } | MIN_SYM '(' in_sum_expr ')' -- cgit v1.2.1