diff options
author | unknown <monty@work.mysql.com> | 2001-04-11 13:04:03 +0200 |
---|---|---|
committer | unknown <monty@work.mysql.com> | 2001-04-11 13:04:03 +0200 |
commit | 8dd2e5b8d93d79965e833e3b979675240478c591 (patch) | |
tree | 9ad58a68370fc8feb8195b7b9c6423d58372093a /sql/sql_yacc.yy | |
parent | 0c971641774f4d06f5442ef23af5d8c7ef9058ab (diff) | |
download | mariadb-git-8dd2e5b8d93d79965e833e3b979675240478c591.tar.gz |
Added all changes from old 4.0 version:
PSTACK, libmysqld and MySQL filesystem
UPDATE ... ORDER BY
DELETE ... ORDER BY
New faster fulltext handling
Faster compressed keys
Makefile.am:
Added support for pstack and libmysqld_dir
acconfig.h:
MySQL filesystem and PSTACK
acinclude.m4:
MySQL File system
client/mysql.cc:
Support for --xml
configure.in:
Pstack, MySQL FS and libmysqld_dir
include/ft_global.h:
Faster fulltext
include/my_pthread.h:
Made c++ safe
include/myisam.h:
Update for faster fulltext
include/mysql_com.h:
new my_net_read()
include/violite.h:
libmysqld
libmysql/net.c:
New protocol that supports big packets
myisam/Makefile.am:
Faster fulltext
myisam/ft_parser.c:
Faster fulltext
myisam/ft_search.c:
Faster fulltext
myisam/ft_update.c:
Faster fulltext
myisam/ftdefs.h:
Faster fulltext
myisam/mi_check.c:
Faster fulltext
myisam/mi_open.c:
Faster compressed keys
myisam/mi_search.c:
Faster compressed keys
myisam/mi_update.c:
Faster compressed keys
myisam/myisamdef.h:
Faster compressed keys
myisam/sort.c:
Faster compressed keys
mysql-test/mysql-test-run.sh:
--skip-innobase and --skip-bdb
sql/ChangeLog:
Changelog
sql/Makefile.am:
PSTACK
sql/mysql_priv.h:
New ORDER BY options and libmysqld
sql/mysqld.cc:
PSTACK
sql/net_serv.cc:
New protocol that supports big packets
sql/share/estonian/errmsg.txt:
New error messages
sql/sql_base.cc:
Better list_open_tabels
sql/sql_delete.cc:
ORDER BY for delete
sql/sql_lex.cc:
Added language convertation of all strings
sql/sql_parse.cc:
Changes for libmysqld
Use new ORDER BY options
sql/sql_show.cc:
Character set convertations
Use new list_open_tables function.
sql/sql_update.cc:
UPDATE ... ORDER BY
sql/sql_yacc.yy:
Clean up symbol definitions
DELETE .. ORDER BY
UPDATE .. ORDER BY
sql/table.h:
new OPEN_TABLE_LIST structure
BitKeeper/etc/logging_ok:
Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql/sql_yacc.yy')
-rw-r--r-- | sql/sql_yacc.yy | 423 |
1 files changed, 226 insertions, 197 deletions
diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index 1196d279e5c..055860bac60 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -72,341 +72,351 @@ bool my_yyoverflow(short **a, YYSTYPE **b,int *yystacksize); %token END_OF_INPUT -%token EQ -%token EQUAL_SYM -%token GE -%token GT_SYM -%token LE -%token LT -%token NE -%token IS -%token SHIFT_LEFT -%token SHIFT_RIGHT -%token SET_VAR - -%token AVG_SYM -%token COUNT_SYM -%token MAX_SYM -%token MIN_SYM -%token SUM_SYM -%token STD_SYM - +%token ACTION %token ADD -%token ALTER %token AFTER_SYM -%token ANALYZE_SYM -%token BEGIN_SYM -%token CHANGE -%token COMMENT_SYM -%token COMMIT_SYM -%token CREATE -%token CROSS -%token DELETE_SYM -%token DROP -%token INSERT -%token FLUSH_SYM -%token SELECT_SYM -%token MASTER_SYM -%token REPAIR -%token RESET_SYM -%token PURGE -%token SLAVE -%token START_SYM -%token STOP_SYM -%token TRUNCATE_SYM -%token ROLLBACK_SYM -%token OPTIMIZE -%token SHOW -%token UPDATE_SYM -%token KILL_SYM -%token LOAD -%token LOCK_SYM -%token UNLOCK_SYM - -%token ACTION +%token AGAINST %token AGGREGATE_SYM %token ALL +%token ALTER +%token ANALYZE_SYM %token AND %token AS %token ASC -%token AUTO_INC +%token ATAN %token AUTOCOMMIT +%token AUTO_INC %token AVG_ROW_LENGTH -%token BACKUP_SYM +%token AVG_SYM +%token BACKUP_SYM +%token BEGIN_SYM +%token BENCHMARK_SYM %token BERKELEY_DB_SYM +%token BETWEEN_SYM +%token BIGINT %token BINARY +%token BIT_AND +%token BIT_OR %token BIT_SYM +%token BLOB_SYM %token BOOL_SYM %token BOTH %token BY %token CASCADE +%token CASE_SYM +%token CHANGE +%token CHANGED +%token CHAR_SYM %token CHECKSUM_SYM %token CHECK_SYM -%token COMMITTED_SYM +%token COALESCE %token COLUMNS %token COLUMN_SYM +%token COMMENT_SYM +%token COMMITTED_SYM +%token COMMIT_SYM +%token COMPRESSED_SYM +%token CONCAT +%token CONCAT_WS %token CONSTRAINT +%token COUNT_SYM +%token CREATE +%token CROSS +%token CURDATE +%token CURTIME +%token DATABASE %token DATABASES %token DATA_SYM +%token DATETIME +%token DATE_ADD_INTERVAL +%token DATE_SUB_INTERVAL +%token DATE_SYM +%token DAY_HOUR_SYM +%token DAY_MINUTE_SYM +%token DAY_SECOND_SYM +%token DAY_SYM +%token DECIMAL_SYM +%token DECODE_SYM %token DEFAULT %token DELAYED_SYM %token DELAY_KEY_WRITE_SYM +%token DELETE_SYM %token DESC %token DESCRIBE %token DISTINCT +%token DOUBLE_SYM +%token DROP +%token DUMPFILE %token DYNAMIC_SYM +%token ELSE +%token ELT_FUNC %token ENCLOSED +%token ENCODE_SYM +%token ENCRYPT +%token END +%token ENUM +%token EQ +%token EQUAL_SYM %token ESCAPED %token ESCAPE_SYM %token EXISTS +%token EXPORT_SET %token EXTENDED_SYM +%token EXTRACT_SYM +%token FAST_SYM +%token FIELD_FUNC %token FILE_SYM %token FIRST_SYM %token FIXED_SYM %token FLOAT_NUM +%token FLOAT_SYM +%token FLUSH_SYM %token FOREIGN +%token FORMAT_SYM +%token FOR_SYM %token FROM +%token FROM_UNIXTIME %token FULL -%token FULLTEXT_SYM -%token GEMINI_SYM +%token FULLTEXT_SYM +%token FUNC_ARG0 +%token FUNC_ARG1 +%token FUNC_ARG2 +%token FUNC_ARG3 +%token GE %token GEMINI_SPIN_RETRIES -%token GLOBAL_SYM +%token GEMINI_SYM +%token GLOBAL_SYM %token GRANT %token GRANTS %token GREATEST_SYM %token GROUP +%token GROUP_UNIQUE_USERS +%token GT_SYM %token HAVING %token HEAP_SYM %token HEX_NUM %token HIGH_PRIORITY %token HOSTS_SYM +%token HOUR_MINUTE_SYM +%token HOUR_SECOND_SYM +%token HOUR_SYM %token IDENT +%token IDENTIFIED_SYM +%token IF %token IGNORE_SYM %token INDEX %token INFILE %token INNER_SYM %token INNOBASE_SYM +%token INSERT +%token INSERT_ID +%token INTERVAL_SYM %token INTO +%token INT_SYM %token IN_SYM -%token ISOLATION +%token IS %token ISAM_SYM +%token ISOLATION %token JOIN_SYM %token KEYS %token KEY_SYM +%token KILL_SYM +%token LAST_INSERT_ID +%token LE %token LEADING %token LEAST_SYM -%token LEVEL_SYM +%token LEFT +%token LEVEL_SYM %token LEX_HOSTNAME %token LIKE +%token LIMIT %token LINES +%token LOAD %token LOCAL_SYM +%token LOCATE +%token LOCK_SYM %token LOGS_SYM +%token LONGBLOB +%token LONGTEXT %token LONG_NUM %token LONG_SYM %token LOW_PRIORITY -%token MASTER_HOST_SYM -%token MASTER_USER_SYM -%token MASTER_LOG_FILE_SYM -%token MASTER_LOG_POS_SYM -%token MASTER_PASSWORD_SYM -%token MASTER_PORT_SYM -%token MASTER_CONNECT_RETRY_SYM +%token LT +%token MAKE_SET_SYM +%token MASTER_CONNECT_RETRY_SYM +%token MASTER_HOST_SYM +%token MASTER_LOG_FILE_SYM +%token MASTER_LOG_POS_SYM +%token MASTER_PASSWORD_SYM +%token MASTER_PORT_SYM +%token MASTER_SYM +%token MASTER_USER_SYM %token MATCH %token MAX_ROWS +%token MAX_SYM +%token MEDIUMBLOB +%token MEDIUMINT +%token MEDIUMTEXT %token MEDIUM_SYM %token MERGE_SYM +%token MINUTE_SECOND_SYM +%token MINUTE_SYM %token MIN_ROWS +%token MIN_SYM +%token MODE_SYM +%token MODIFY_SYM +%token MONTH_SYM %token MYISAM_SYM %token NATIONAL_SYM %token NATURAL %token NCHAR_SYM +%token NE %token NOT +%token NOW_SYM %token NO_SYM %token NULL_SYM %token NUM +%token NUMERIC_SYM %token ON %token OPEN_SYM +%token OPTIMIZE %token OPTION %token OPTIONALLY %token OR -%token OR_OR_CONCAT %token ORDER_SYM +%token OR_OR_CONCAT %token OUTER %token OUTFILE -%token DUMPFILE %token PACK_KEYS_SYM %token PARTIAL +%token PASSWORD +%token POSITION_SYM +%token PRECISION %token PRIMARY_SYM %token PRIVILEGES +%token PROCEDURE %token PROCESS %token PROCESSLIST_SYM +%token PURGE +%token QUICK %token RAID_0_SYM -%token RAID_STRIPED_SYM -%token RAID_TYPE %token RAID_CHUNKS %token RAID_CHUNKSIZE +%token RAID_STRIPED_SYM +%token RAID_TYPE +%token RAND %token READ_SYM +%token REAL %token REAL_NUM %token REFERENCES %token REGEXP %token RELOAD %token RENAME +%token REPAIR %token REPEATABLE_SYM -%token RESTORE_SYM +%token REPLACE +%token RESET_SYM +%token RESTORE_SYM %token RESTRICT %token REVOKE +%token RIGHT +%token ROLLBACK_SYM +%token ROUND %token ROWS_SYM %token ROW_FORMAT_SYM %token ROW_SYM -%token SET +%token SECOND_SYM +%token SELECT_SYM %token SERIALIZABLE_SYM %token SESSION_SYM +%token SET +%token SET_VAR +%token SHARE_SYM +%token SHIFT_LEFT +%token SHIFT_RIGHT +%token SHOW %token SHUTDOWN +%token SLAVE +%token SMALLINT +%token SQL_AUTO_IS_NULL +%token SQL_BIG_RESULT +%token SQL_BIG_SELECTS +%token SQL_BIG_TABLES +%token SQL_BUFFER_RESULT +%token SQL_LOG_BIN +%token SQL_LOG_OFF +%token SQL_LOG_UPDATE +%token SQL_LOW_PRIORITY_UPDATES +%token SQL_MAX_JOIN_SIZE +%token SQL_QUOTE_SHOW_CREATE +%token SQL_SAFE_UPDATES +%token SQL_SELECT_LIMIT +%token SQL_SMALL_RESULT +%token SQL_WARNINGS %token STARTING +%token START_SYM %token STATUS_SYM +%token STD_SYM +%token STOP_SYM %token STRAIGHT_JOIN +%token STRING_SYM +%token SUBSTRING +%token SUBSTRING_INDEX +%token SUM_SYM %token TABLES %token TABLE_SYM %token TEMPORARY %token TERMINATED %token TEXT_STRING -%token TO_SYM -%token TRAILING -%token TRANSACTION_SYM -%token TYPE_SYM -%token FUNC_ARG0 -%token FUNC_ARG1 -%token FUNC_ARG2 -%token FUNC_ARG3 -%token UDF_RETURNS_SYM -%token UDF_SONAME_SYM -%token UDF_SYM -%token UNCOMMITTED_SYM -%token UNION_SYM -%token UNIQUE_SYM -%token USAGE -%token USE_SYM -%token USING -%token VALUES -%token VARIABLES -%token WHERE -%token WITH -%token WRITE_SYM -%token COMPRESSED_SYM - -%token BIGINT -%token BLOB_SYM -%token CHAR_SYM -%token CHANGED -%token COALESCE -%token DATETIME -%token DATE_SYM -%token DECIMAL_SYM -%token DOUBLE_SYM -%token ENUM -%token FAST_SYM -%token FLOAT_SYM -%token INT_SYM -%token LIMIT -%token LONGBLOB -%token LONGTEXT -%token MEDIUMBLOB -%token MEDIUMINT -%token MEDIUMTEXT -%token NUMERIC_SYM -%token PRECISION -%token QUICK -%token REAL -%token SMALLINT -%token STRING_SYM %token TEXT_SYM +%token THEN_SYM %token TIMESTAMP %token TIME_SYM %token TINYBLOB %token TINYINT %token TINYTEXT -%token UNSIGNED -%token VARBINARY -%token VARCHAR -%token VARYING -%token ZEROFILL - -%token AGAINST -%token ATAN -%token BETWEEN_SYM -%token BIT_AND -%token BIT_OR -%token CASE_SYM -%token CONCAT -%token CONCAT_WS -%token CURDATE -%token CURTIME -%token DATABASE -%token DATE_ADD_INTERVAL -%token DATE_SUB_INTERVAL -%token DAY_HOUR_SYM -%token DAY_MINUTE_SYM -%token DAY_SECOND_SYM -%token DAY_SYM -%token DECODE_SYM -%token ELSE -%token ELT_FUNC -%token ENCODE_SYM -%token ENCRYPT -%token EXPORT_SET -%token EXTRACT_SYM -%token FIELD_FUNC -%token FORMAT_SYM -%token FOR_SYM -%token FROM_UNIXTIME -%token GROUP_UNIQUE_USERS -%token HOUR_MINUTE_SYM -%token HOUR_SECOND_SYM -%token HOUR_SYM -%token IDENTIFIED_SYM -%token IF -%token INSERT_ID -%token INTERVAL_SYM -%token LAST_INSERT_ID -%token LEFT -%token LOCATE -%token MAKE_SET_SYM -%token MINUTE_SECOND_SYM -%token MINUTE_SYM -%token MODE_SYM -%token MODIFY_SYM -%token MONTH_SYM -%token NOW_SYM -%token PASSWORD -%token POSITION_SYM -%token PROCEDURE -%token RAND -%token REPLACE -%token RIGHT -%token ROUND -%token SECOND_SYM -%token SHARE_SYM -%token SUBSTRING -%token SUBSTRING_INDEX +%token TO_SYM +%token TRAILING +%token TRANSACTION_SYM %token TRIM +%token TRUNCATE_SYM +%token TYPE_SYM %token UDA_CHAR_SUM %token UDA_FLOAT_SUM %token UDA_INT_SUM %token UDF_CHAR_FUNC %token UDF_FLOAT_FUNC %token UDF_INT_FUNC +%token UDF_RETURNS_SYM +%token UDF_SONAME_SYM +%token UDF_SYM +%token UNCOMMITTED_SYM +%token UNION_SYM +%token UNIQUE_SYM %token UNIQUE_USERS %token UNIX_TIMESTAMP +%token UNLOCK_SYM +%token UNSIGNED +%token UPDATE_SYM +%token USAGE %token USER +%token USE_SYM +%token USING +%token VALUES +%token VARBINARY +%token VARCHAR +%token VARIABLES +%token VARYING %token WEEK_SYM %token WHEN_SYM -%token WORK_SYM +%token WHERE +%token WITH +%token WORK_SYM +%token WRITE_SYM +%token YEARWEEK %token YEAR_MONTH_SYM %token YEAR_SYM -%token YEARWEEK -%token BENCHMARK_SYM -%token END -%token THEN_SYM +%token ZEROFILL %token SQL_BIG_TABLES %token SQL_BIG_SELECTS @@ -1240,7 +1250,7 @@ select: select_options select_item_list select_into select_lock_type select_into: - /* empty */ + limit_clause {} | select_from | opt_into select_from | select_from opt_into @@ -2128,8 +2138,17 @@ values: /* Update rows in a table */ update: - UPDATE_SYM opt_low_priority opt_ignore table SET update_list where_clause delete_limit_clause - { Lex->sql_command = SQLCOM_UPDATE; } + UPDATE_SYM opt_low_priority opt_ignore table + SET update_list + where_clause + opt_order_clause + delete_limit_clause + { + Lex->sql_command = SQLCOM_UPDATE; + Lex->order_list.elements=0; + Lex->order_list.first=0; + Lex->order_list.next= (byte**) &Lex->order_list.first; + } update_list: update_list ',' simple_ident equal expr @@ -2151,12 +2170,15 @@ opt_low_priority: delete: DELETE_SYM - { - Lex->sql_command= SQLCOM_DELETE; Lex->options=0; + { + Lex->sql_command= SQLCOM_DELETE; Lex->options=0; Lex->lock_option= current_thd->update_lock_default; - } + Lex->order_list.elements=0; + Lex->order_list.first=0; + Lex->order_list.next= (byte**) &Lex->order_list.first; + } opt_delete_options FROM table - where_clause delete_limit_clause + where_clause opt_order_clause delete_limit_clause opt_delete_options: @@ -2169,8 +2191,15 @@ opt_delete_option: truncate: TRUNCATE_SYM opt_table_sym table - { Lex->sql_command= SQLCOM_TRUNCATE; Lex->options=0; - Lex->lock_option= current_thd->update_lock_default; } + { + LEX* lex = Lex; + lex->sql_command= SQLCOM_TRUNCATE; + lex->options=0; + lex->order_list.elements=0; + lex->order_list.first=0; + lex->order_list.next= (byte**) &lex->order_list.first; + + lex->lock_option= current_thd->update_lock_default; } opt_table_sym: /* empty */ |