Merge branch 'default-to-colstore' of https://github.com/pivotalsoftware/quickstep into default-to-colstore
diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt
index 4fd81c3..ba33260 100644
--- a/parser/CMakeLists.txt
+++ b/parser/CMakeLists.txt
@@ -98,6 +98,7 @@
 add_library(quickstep_parser_ParseSimpleTableReference ParseSimpleTableReference.cpp ParseSimpleTableReference.hpp)
 add_library(quickstep_parser_ParseStatement ../empty_src.cpp ParseStatement.hpp)
 add_library(quickstep_parser_ParseString ParseString.cpp ParseString.hpp)
+add_library(quickstep_parser_ParseKeyValue ../empty_src.cpp ParseKeyValue.hpp)
 add_library(quickstep_parser_ParseSubqueryExpression ParseSubqueryExpression.cpp ParseSubqueryExpression.hpp)
 add_library(quickstep_parser_ParseSubqueryTableReference ParseSubqueryTableReference.cpp ParseSubqueryTableReference.hpp)
 add_library(quickstep_parser_ParseTableReference ParseTableReference.cpp ParseTableReference.hpp)
@@ -206,6 +207,12 @@
 target_link_libraries(quickstep_parser_ParseString
                       quickstep_parser_ParseTreeNode
                       quickstep_utility_Macros)
+target_link_libraries(quickstep_parser_ParseKeyValue
+                      quickstep_parser_ParseLiteralValue
+                      quickstep_parser_ParseString
+                      quickstep_parser_ParseTreeNode
+                      quickstep_utility_Macros
+                      quickstep_utility_PtrList)
 target_link_libraries(quickstep_parser_ParseSubqueryExpression
                       glog
                       quickstep_parser_ParseExpression
@@ -239,6 +246,7 @@
                       quickstep_parser_ParseGroupBy
                       quickstep_parser_ParseHaving
                       quickstep_parser_ParseExpression
+                      quickstep_parser_ParseKeyValue
                       quickstep_parser_ParseLimit
                       quickstep_parser_ParseLiteralValue
                       quickstep_parser_ParseOrderBy
@@ -310,6 +318,7 @@
                       quickstep_parser_ParseSimpleTableReference
                       quickstep_parser_ParseStatement
                       quickstep_parser_ParseString
+                      quickstep_parser_ParseKeyValue
                       quickstep_parser_ParseSubqueryExpression
                       quickstep_parser_ParseSubqueryTableReference
                       quickstep_parser_ParseTableReference
diff --git a/parser/ParseKeyValue.hpp b/parser/ParseKeyValue.hpp
new file mode 100644
index 0000000..9832e95
--- /dev/null
+++ b/parser/ParseKeyValue.hpp
@@ -0,0 +1,254 @@
+/**
+ *   Copyright 2016 Pivotal Software, Inc.
+ *
+ *   Licensed under the Apache License, Version 2.0 (the "License");
+ *   you may not use this file except in compliance with the License.
+ *   You may obtain a copy of the License at
+ *
+ *       http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ **/
+
+#ifndef QUICKSTEP_PARSER_PARSE_KEY_VALUE_HPP_
+#define QUICKSTEP_PARSER_PARSE_KEY_VALUE_HPP_
+
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "parser/ParseLiteralValue.hpp"
+#include "parser/ParseString.hpp"
+#include "parser/ParseTreeNode.hpp"
+#include "utility/Macros.hpp"
+#include "utility/PtrList.hpp"
+
+namespace quickstep {
+
+/**
+ * @brief Base class for the Parse Key Values.
+ */
+class ParseKeyValue : public ParseTreeNode {
+ public:
+  enum class KeyValueType {
+    kStringString,
+    kStringStringList,
+    kStringLiteral
+  };
+
+  /**
+   * @brief Single value constructor.
+   *
+   * @param line_number Line number of the first token of this node in the SQL statement.
+   * @param column_number Column number of the first token of this node in the SQL statement.
+   * @param value A single literal value.
+   **/
+  ParseKeyValue(const int line_number,
+                const int column_number,
+                ParseString *key)
+      : ParseTreeNode(line_number, column_number),
+        key_(key) { }
+
+  /**
+   * @brief Destructor.
+   **/
+  ~ParseKeyValue() override { }
+
+  /**
+   * @brief Get the subclass type of the parse key value.
+   */
+  virtual KeyValueType getKeyValueType() const = 0;
+
+  /**
+   * @return Pointer to the key string.
+   */
+  const ParseString* key() const {
+    return key_.get();
+  }
+
+  std::string getName() const override {
+    return "KeyValue";
+  }
+
+ protected:
+  std::unique_ptr<ParseString> key_;
+};
+
+/**
+ * @brief The parsed representation of a key-value pair.
+ **/
+class ParseKeyStringValue : public ParseKeyValue {
+ public:
+  /**
+   * @brief Single value constructor.
+   *
+   * @param line_number Line number of the first token of this node in the SQL statement.
+   * @param column_number Column number of the first token of this node in the SQL statement.
+   * @param key A parse string representing the key.
+   * @param value A parse string representing the key.
+   **/
+  ParseKeyStringValue(const int line_number,
+                      const int column_number,
+                      ParseString *key,
+                      ParseString *value)
+      : ParseKeyValue(line_number, column_number, key),
+        value_(value) { }
+
+  KeyValueType getKeyValueType() const override {
+    return ParseKeyValue::KeyValueType::kStringString;
+  }
+
+  /**
+   * @return A pointer to the value ParseString.
+   */
+  const ParseString* value() const {
+    return value_.get();
+  }
+
+  std::string getName() const override {
+    return "KeyStringValue";
+  }
+
+ protected:
+  void getFieldStringItems(
+      std::vector<std::string> *inline_field_names,
+      std::vector<std::string> *inline_field_values,
+      std::vector<std::string> *non_container_child_field_names,
+      std::vector<const ParseTreeNode*> *non_container_child_fields,
+      std::vector<std::string> *container_child_field_names,
+      std::vector<std::vector<const ParseTreeNode*>> *container_child_fields) const override {
+    inline_field_names->push_back("key");
+    inline_field_values->push_back(key_->value());
+
+    non_container_child_field_names->push_back("value");
+    non_container_child_fields->push_back(value_.get());
+  }
+
+ private:
+  std::unique_ptr<ParseString> value_;
+
+  DISALLOW_COPY_AND_ASSIGN(ParseKeyStringValue);
+};
+
+/**
+ * @brief The parsed representation of a key-value pair. Value is a list of values.
+ **/
+class ParseKeyStringList : public ParseKeyValue {
+ public:
+  /**
+   * @brief Single value constructor.
+   *
+   * @param line_number Line number of the first token of this node in the SQL statement.
+   * @param column_number Column number of the first token of this node in the SQL statement.
+   * @param key A parse string representing the key.
+   * @param value A list of string values.
+   **/
+  ParseKeyStringList(const int line_number,
+                     const int column_number,
+                     ParseString *key,
+                     PtrList<ParseString> *value)
+      : ParseKeyValue(line_number, column_number, key),
+        value_(value) { }
+
+  KeyValueType getKeyValueType() const override {
+    return ParseKeyValue::KeyValueType::kStringStringList;
+  }
+
+  /**
+   * @return A list of ParseStrings.
+   */
+  const PtrList<ParseString>* value() const {
+    return value_.get();
+  }
+
+  std::string getName() const override {
+    return "KeyStringList";
+  }
+
+ protected:
+  void getFieldStringItems(
+      std::vector<std::string> *inline_field_names,
+      std::vector<std::string> *inline_field_values,
+      std::vector<std::string> *non_container_child_field_names,
+      std::vector<const ParseTreeNode*> *non_container_child_fields,
+      std::vector<std::string> *container_child_field_names,
+      std::vector<std::vector<const ParseTreeNode*>> *container_child_fields) const override {
+    inline_field_names->push_back("key");
+    inline_field_values->push_back(key_->value());
+
+    container_child_field_names->push_back("value_list");
+    container_child_fields->emplace_back();
+    for (const ParseString &value : *value_) {
+      container_child_fields->back().push_back(&value);
+    }
+  }
+
+ private:
+  std::unique_ptr<PtrList<ParseString> > value_;
+
+  DISALLOW_COPY_AND_ASSIGN(ParseKeyStringList);
+};
+
+/**
+ * @brief The parsed representation of a key-value pair.
+ **/
+class ParseKeyLiteralValue : public ParseKeyValue {
+ public:
+  /**
+   * @brief Single value constructor.
+   *
+   * @param line_number Line number of the first token of this node in the SQL statement.
+   * @param column_number Column number of the first token of this node in the SQL statement.
+   * @param key A parse string representing the key.
+   * @param value A single literal value.
+   **/
+  ParseKeyLiteralValue(const int line_number,
+                       const int column_number,
+                       ParseString *key,
+                       ParseLiteralValue *value)
+      : ParseKeyValue(line_number, column_number, key),
+        value_(value) { }
+
+  KeyValueType getKeyValueType() const override {
+    return ParseKeyValue::KeyValueType::kStringLiteral;
+  }
+
+  /**
+   * @return A pointer to the value ParseString.
+   */
+  const ParseLiteralValue* value() const {
+    return value_.get();
+  }
+
+  std::string getName() const override {
+    return "KeyLiteralValue";
+  }
+
+ protected:
+  void getFieldStringItems(
+      std::vector<std::string> *inline_field_names,
+      std::vector<std::string> *inline_field_values,
+      std::vector<std::string> *non_container_child_field_names,
+      std::vector<const ParseTreeNode*> *non_container_child_fields,
+      std::vector<std::string> *container_child_field_names,
+      std::vector<std::vector<const ParseTreeNode*>> *container_child_fields) const override {
+    inline_field_names->push_back("key");
+    inline_field_values->push_back(key_->value());
+
+    non_container_child_field_names->push_back("value");
+    non_container_child_fields->push_back(value_.get());
+  }
+
+ private:
+  std::unique_ptr<ParseLiteralValue> value_;
+
+  DISALLOW_COPY_AND_ASSIGN(ParseKeyLiteralValue);
+};
+
+}  // namespace quickstep
+
+#endif  // QUICKSTEP_PARSER_PARSE_KEY_VALUE_HPP_
diff --git a/parser/SqlLexer.lpp b/parser/SqlLexer.lpp
index dc49f4e..f1d25cb 100644
--- a/parser/SqlLexer.lpp
+++ b/parser/SqlLexer.lpp
@@ -46,6 +46,10 @@
 class ParseFunctionCall;
 class ParseGroupBy;
 class ParseHaving;
+class ParseKeyValue;
+class ParseKeyStringValue;
+class ParseKeyStringList;
+class ParseKeyLiteralValue;
 class ParseLimit;
 class ParseOrderBy;
 class ParseOrderByItem;
@@ -57,6 +61,7 @@
 class ParseSelectionItemScalar;
 class ParseSelectionList;
 class ParseSimpleTableReference;
+class ParseStringKeyLiteralValues;
 class ParseStatement;
 class ParseStatementCopyFrom;
 class ParseStatementCreateTable;
@@ -120,6 +125,8 @@
 "between"          return TOKEN_BETWEEN;
 "bigint"           return TOKEN_BIGINT;
 "bit"              return TOKEN_BIT;
+"bloomfilter"      return TOKEN_BLOOM_FILTER;
+"csbtree"          return TOKEN_CSB_TREE;
 "by"               return TOKEN_BY;
 "char"             return TOKEN_CHARACTER;
 "character"        return TOKEN_CHARACTER;
@@ -148,6 +155,7 @@
 "full"             return TOKEN_FULL;
 "group"            return TOKEN_GROUP;
 "having"           return TOKEN_HAVING;
+"index"            return TOKEN_INDEX;
 "inner"            return TOKEN_INNER;
 "insert"           return TOKEN_INSERT;
 "int"              return TOKEN_INTEGER;
@@ -185,6 +193,7 @@
 "true"             return TOKEN_TRUE;
 "unique"           return TOKEN_UNIQUE;
 "update"           return TOKEN_UPDATE;
+"using"            return TOKEN_USING;
 "values"           return TOKEN_VALUES;
 "varchar"          return TOKEN_VARCHAR;
 "where"            return TOKEN_WHERE;
diff --git a/parser/SqlParser.ypp b/parser/SqlParser.ypp
index 40eef40..0c16c6b 100644
--- a/parser/SqlParser.ypp
+++ b/parser/SqlParser.ypp
@@ -70,6 +70,7 @@
 #include "parser/ParseExpression.hpp"
 #include "parser/ParseGroupBy.hpp"
 #include "parser/ParseHaving.hpp"
+#include "parser/ParseKeyValue.hpp"
 #include "parser/ParseLimit.hpp"
 #include "parser/ParseLiteralValue.hpp"
 #include "parser/ParseOrderBy.hpp"
@@ -136,6 +137,12 @@
   quickstep::PtrList<quickstep::ParseColumnConstraint> *column_constraint_list_;
   quickstep::PtrList<quickstep::ParseAttributeDefinition> *attribute_definition_list_;
 
+  quickstep::ParseKeyValue *key_value_;
+  quickstep::PtrList<quickstep::ParseKeyValue> *key_value_list_;
+  quickstep::ParseKeyStringValue *key_string_value_;
+  quickstep::ParseKeyStringList *key_string_list_;
+  quickstep::ParseKeyLiteralValue *key_literal_value_;
+
   quickstep::ParseCopyFromParams *copy_from_params_;
 
   quickstep::ParseAssignment *assignment_;
@@ -205,6 +212,8 @@
 %token TOKEN_ASC;
 %token TOKEN_BIGINT;
 %token TOKEN_BIT;
+%token TOKEN_BLOOM_FILTER;
+%token TOKEN_CSB_TREE;
 %token TOKEN_BY;
 %token TOKEN_CHARACTER;
 %token TOKEN_CHECK;
@@ -231,6 +240,7 @@
 %token TOKEN_FULL;
 %token TOKEN_GROUP;
 %token TOKEN_HAVING;
+%token TOKEN_INDEX;
 %token TOKEN_INNER;
 %token TOKEN_INSERT;
 %token TOKEN_INTEGER;
@@ -265,6 +275,7 @@
 %token TOKEN_TRUE;
 %token TOKEN_UNIQUE;
 %token TOKEN_UPDATE;
+%token TOKEN_USING;
 %token TOKEN_VALUES;
 %token TOKEN_VARCHAR;
 %token TOKEN_WHERE;
@@ -275,6 +286,7 @@
 
 %type <string_value_>
   any_name
+  index_type
 
 %type <boolean_value_>
   boolean_value
@@ -341,6 +353,22 @@
 %type <attribute_definition_list_>
   column_def_commalist
 
+%type <key_value_>
+  key_value
+
+%type <key_value_list_>
+  key_value_list
+  opt_index_properties
+
+%type <key_string_value_>
+  key_string_value
+
+%type <key_string_list_>
+  key_string_list
+
+%type <key_literal_value_>
+  key_literal_value
+
 %type <assignment_>
   assignment_item
 
@@ -376,6 +404,9 @@
 %type <create_table_statement_>
   create_table_statement
 
+%type <statement_>
+  create_index_statement
+
 %type <drop_table_statement_>
   drop_table_statement
 
@@ -384,6 +415,7 @@
 
 %type <string_list_>
   name_commalist
+  opt_column_list
 
 %type <comparison_>
   comparison_operation
@@ -483,6 +515,9 @@
   | create_table_statement {
     $$ = $1;
   }
+  | create_index_statement {
+    $$ = $1;
+  }
   | delete_statement {
     $$ = $1;
   }
@@ -543,6 +578,18 @@
     $$ = new quickstep::ParseStatementCreateTable(@1.first_line, @1.first_column, $3, $5);
   };
 
+create_index_statement:
+  TOKEN_CREATE TOKEN_INDEX any_name TOKEN_ON any_name opt_column_list TOKEN_USING index_type opt_index_properties {
+    delete $3;
+    delete $5;
+    delete $6;
+    delete $8;
+    delete $9;
+    $$ = nullptr;
+    NotSupported(&@1, yyscanner, "CREATE INDEX statement");
+    YYERROR;
+  };
+
 drop_table_statement:
   TOKEN_DROP TOKEN_TABLE any_name {
     $$ = new quickstep::ParseStatementDropTable(@1.first_line, @1.first_column, $3);
@@ -759,6 +806,74 @@
     /* $$ = $1; */
   };
 
+opt_column_list:
+  {
+    $$ = nullptr;
+  }
+  | '(' name_commalist ')' {
+    delete $2;
+    $$ = nullptr;
+    NotSupported(&@1, yyscanner, "list of column names in CREATE INDEX statement");
+    YYERROR;
+  };
+
+key_value_list:
+  key_value {
+    $$ = new quickstep::PtrList<quickstep::ParseKeyValue>();
+    $$->push_back($1);
+  }
+  | key_value_list ',' key_value {
+    $$ = $1;
+    $$->push_back($3);
+  };
+
+key_value:
+  key_string_value {
+    $$ = $1;
+  }
+  | key_string_list {
+    $$ = $1;
+  }
+  | key_literal_value {
+    $$ = $1;
+  };
+
+key_string_value:
+  any_name any_name {
+    $$ = new quickstep::ParseKeyStringValue(@1.first_line, @1.first_column, $1, $2);
+  };
+
+key_string_list:
+  any_name '(' name_commalist ')' {
+    $$ = new quickstep::ParseKeyStringList(@1.first_line, @1.first_column, $1, $3);
+  };
+
+key_literal_value:
+  any_name literal_value {
+    $$ = new quickstep::ParseKeyLiteralValue(@1.first_line, @1.first_column, $1, $2);
+  };
+
+index_type:
+  TOKEN_BLOOM_FILTER {
+    $$ = nullptr;
+    NotSupported(&@1, yyscanner, "Bloom Filter Index");
+    YYERROR;
+  }
+  | TOKEN_CSB_TREE {
+    $$ = nullptr;
+    NotSupported(&@1, yyscanner, "CSB Tree Index");
+    YYERROR;
+  };
+
+opt_index_properties:
+  {
+    $$ = nullptr;
+  }
+  | '(' key_value_list ')' {
+    $$ = $2;
+  };
+
+
 /* Update Database Contents */
 insert_statement:
   TOKEN_INSERT TOKEN_INTO any_name '(' name_commalist ')' TOKEN_VALUES '(' literal_value_commalist ')' {
diff --git a/parser/SqlParserWrapper.cpp b/parser/SqlParserWrapper.cpp
index 26f4bc3..d1dbbc8 100644
--- a/parser/SqlParserWrapper.cpp
+++ b/parser/SqlParserWrapper.cpp
@@ -37,6 +37,10 @@
 class ParseColumnConstraint;
 class ParseDataType;
 class ParseFunctionCall;
+class ParseKeyValue;
+class ParseKeyStringValue;
+class ParseKeyStringList;
+class ParseKeyLiteralValue;
 class ParseLiteralValue;
 class ParsePredicate;
 class ParseScalarLiteral;
diff --git a/parser/preprocessed/SqlLexer_gen.cpp b/parser/preprocessed/SqlLexer_gen.cpp
index 8e5a4e3..fefb34b 100644
--- a/parser/preprocessed/SqlLexer_gen.cpp
+++ b/parser/preprocessed/SqlLexer_gen.cpp
@@ -370,8 +370,8 @@
 	*yy_cp = '\0'; \
 	yyg->yy_c_buf_p = yy_cp;
 
-#define YY_NUM_RULES 116
-#define YY_END_OF_BUFFER 117
+#define YY_NUM_RULES 120
+#define YY_END_OF_BUFFER 121
 /* This struct is not used in this scanner,
    but its presence is necessary. */
 struct yy_trans_info
@@ -379,53 +379,55 @@
 	flex_int32_t yy_verify;
 	flex_int32_t yy_nxt;
 	};
-static yyconst flex_int16_t yy_accept[404] =
+static yyconst flex_int16_t yy_accept[427] =
     {   0,
-        0,    0,    0,    0,    0,    0,    0,    0,  117,  115,
-      113,  112,  115,   92,   88,   91,   88,   88,  111,   84,
-       81,   85,  110,  110,  110,  110,  110,  110,  110,  110,
-      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
-      110,  110,  110,  110,  110,  110,   89,  107,  104,  108,
-      102,  109,  106,  113,   82,  114,  111,  111,  111,    0,
-       86,   83,   87,  110,  110,  110,  110,    5,  110,  110,
-       11,  110,  110,  110,  110,  110,  110,  110,  110,   90,
-      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
-       45,  110,  110,  110,  110,  110,  110,  110,  110,  110,
+        0,    0,    0,    0,    0,    0,    0,    0,  121,  119,
+      117,  116,  119,   96,   92,   95,   92,   92,  115,   88,
+       85,   89,  114,  114,  114,  114,  114,  114,  114,  114,
+      114,  114,  114,  114,  114,  114,  114,  114,  114,  114,
+      114,  114,  114,  114,  114,  114,   93,  111,  108,  112,
+      106,  113,  110,  117,   86,  118,  115,  115,  115,    0,
+       90,   87,   91,  114,  114,  114,  114,    5,  114,  114,
+      114,   13,  114,  114,  114,  114,  114,  114,  114,  114,
+      114,   94,  114,  114,  114,  114,  114,  114,  114,  114,
+      114,  114,   48,  114,  114,  114,  114,  114,  114,  114,
 
-       57,   58,  110,  110,  110,  110,  110,  110,  110,  110,
-      110,  110,  110,  110,  110,  110,  110,  110,  110,  107,
-      103,  108,  101,  101,   93,   95,   96,   97,   98,   99,
-      100,  101,  109,  105,  114,  111,    0,  111,    1,    2,
-      110,    4,    6,  110,  110,   10,  110,  110,  110,  110,
-      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
-      110,  110,  110,  110,  110,  110,  110,  110,  110,  110,
-      110,   41,  110,   47,  110,  110,  110,  110,  110,   53,
-      110,   56,  110,  110,  110,  110,  110,  110,  110,  110,
-      110,   68,  110,  110,  110,  110,  110,  110,  110,  110,
+      114,  114,   60,   61,  114,  114,  114,  114,  114,  114,
+      114,  114,  114,  114,  114,  114,  114,  114,  114,  114,
+      114,  114,  111,  107,  112,  105,  105,   97,   99,  100,
+      101,  102,  103,  104,  105,  113,  109,  118,  115,    0,
+      115,    1,    2,  114,    4,    6,  114,  114,   10,  114,
+      114,  114,  114,  114,  114,  114,  114,  114,  114,  114,
+      114,  114,  114,  114,  114,  114,  114,  114,  114,  114,
+      114,  114,  114,  114,  114,  114,  114,   44,  114,   50,
+      114,  114,  114,  114,  114,   56,  114,   59,  114,  114,
+      114,  114,  114,  114,  114,  114,  114,   71,  114,  114,
 
-      110,  110,  110,   93,   95,   94,  110,  110,  110,  110,
-       12,  110,  110,  110,   17,  110,   19,  110,  110,  110,
-      110,   25,  110,  110,   29,  110,  110,  110,  110,  110,
-       35,   36,  110,  110,  110,  110,  110,   44,   46,   48,
-       49,   50,  110,   52,   54,  110,  110,  110,   62,   63,
-      110,  110,  110,  110,  110,  110,   71,   73,  110,  110,
-      110,  110,  110,   79,  110,   93,   94,    3,  110,  110,
-      110,  110,   14,  110,  110,  110,  110,  110,  110,  110,
-      110,  110,  110,  110,  110,   31,   32,   33,  110,   37,
-      110,   39,  110,  110,  110,   51,   55,   59,   60,  110,
+      114,  114,  114,  114,  114,  114,  114,  114,  114,  114,
+       97,   99,   98,  114,  114,  114,  114,  114,   14,  114,
+      114,  114,   19,  114,  114,   21,  114,  114,  114,  114,
+       27,  114,  114,   31,  114,  114,  114,  114,  114,   37,
+       38,  114,  114,  114,  114,  114,  114,   47,   49,   51,
+       52,   53,  114,   55,   57,  114,  114,  114,   65,   66,
+      114,  114,  114,  114,  114,  114,   74,   76,  114,  114,
+      114,  114,  114,  114,   83,  114,   97,   98,    3,  114,
+      114,  114,  114,  114,   16,  114,  114,  114,  114,  114,
+      114,  114,  114,  114,  114,  114,  114,  114,   33,   34,
 
-      110,   65,  110,  110,  110,   70,  110,  110,  110,  110,
-      110,   78,  110,  110,  110,    9,  110,   15,  110,   18,
-      110,  110,  110,   23,  110,  110,  110,   28,  110,  110,
-       38,   40,  110,  110,  110,  110,  110,   67,  110,  110,
-       74,   75,   76,  110,  110,  110,    8,  110,  110,  110,
-       21,   22,  110,  110,  110,  110,   34,   42,  110,   61,
-      110,  110,  110,  110,   77,  110,  110,  110,  110,   20,
-      110,  110,   27,  110,   43,  110,  110,   69,  110,  110,
-        7,   13,  110,   24,  110,  110,  110,  110,   72,   80,
-       16,   26,  110,   64,  110,  110,  110,  110,  110,  110,
+       35,  114,   39,  114,   41,   42,  114,  114,  114,   54,
+       58,   62,   63,  114,  114,   68,  114,  114,  114,   73,
+      114,  114,  114,   79,  114,  114,   82,  114,  114,  114,
+        9,  114,  114,   17,  114,   20,  114,  114,  114,  114,
+       25,  114,  114,  114,   30,  114,  114,   40,   43,  114,
+      114,  114,  114,  114,   70,  114,  114,   77,   78,   80,
+      114,  114,  114,    8,  114,  114,  114,   12,  114,   23,
+       24,  114,  114,  114,  114,   36,   45,  114,   64,  114,
+      114,  114,  114,   81,  114,  114,  114,  114,  114,   22,
+      114,  114,   29,  114,   46,  114,  114,   72,  114,  114,
 
-       66,   30,    0
+        7,  114,   15,  114,   26,  114,  114,  114,  114,   75,
+       84,  114,   18,   28,  114,   67,  114,   11,  114,  114,
+      114,  114,  114,   69,   32,    0
     } ;
 
 static yyconst flex_int32_t yy_ec[256] =
@@ -471,107 +473,111 @@
         6,    6,    6,    6,    6,    6,    6,    6,    6,    6
     } ;
 
-static yyconst flex_int16_t yy_base[415] =
+static yyconst flex_int16_t yy_base[438] =
     {   0,
-        0,    0,  750,  749,   63,   64,  750,  532,  256,  839,
-       71,  839,  234,  839,  839,  839,  225,   64,   67,   66,
-      839,  216,   63,   64,   63,   75,   66,  122,   50,   69,
-       60,   68,   81,  115,    0,  106,  111,  108,  107,  133,
-      128,  164,  160,  134,  170,  134,  839,    0,  221,    0,
-      224,    0,  219,  195,  839,    0,  188,  190,  193,  203,
-      839,  839,  839,    0,  147,  194,  171,  207,  196,  211,
-        0,  224,  220,  212,  203,  250,  209,  216,  226,  839,
-      246,  238,  233,  249,  250,  257,  262,  260,  254,  267,
-        0,  274,  259,  269,  283,  279,  280,  275,  284,  293,
+        0,    0,  259,  247,   63,   64,  245,  243,  245,  900,
+       71,  900,  222,  900,  900,  900,  194,   64,   67,   66,
+      900,  174,   63,   64,   66,  107,   76,  154,   40,   69,
+      101,   56,   73,  118,    0,  114,  147,   62,   67,  162,
+      165,  184,  160,   96,  122,  116,  900,    0,  146,    0,
+      244,    0,  146,  146,  900,    0,  184,  214,  220,  146,
+      900,  900,  900,    0,  124,  171,  205,  210,  203,  217,
+      211,    0,  229,  231,  222,  226,  216,  277,  225,  228,
+      246,  900,  266,  258,  253,  262,  263,  267,  272,  270,
+      264,  288,    0,  279,  269,  276,  295,  292,  290,  296,
 
-        0,  296,  282,  297,  298,  308,  301,  288,  310,  319,
-      324,  314,  311,  324,  330,  327,  336,  322,  343,    0,
-      839,    0,  839,  839,   91,   98,  839,  839,  839,  839,
-      839,    0,    0,  839,    0,  361,  195,  350,    0,    0,
-      343,    0,  345,  329,  344,    0,  336,  357,  343,  346,
-      342,  368,  367,  366,  375,  375,  375,  365,  384,  371,
-      387,  371,  372,  391,  392,  386,  388,  381,  394,  401,
-      403,  407,  396,    0,  391,  398,  418,  415,  418,    0,
-      415,    0,  425,  428,  421,  416,  426,  437,  435,  172,
-      439,    0,  433,  434,  443,  444,  433,  454,  436,  455,
+      307,  314,    0,  318,  306,  318,  319,  334,  322,  315,
+      327,  340,  340,  330,  323,  337,  346,  343,  341,  349,
+      340,  360,    0,  900,    0,  900,  900,   97,  150,  900,
+      900,  900,  900,  900,    0,    0,  900,    0,  369,  190,
+      366,    0,    0,  372,    0,  373,  357,  375,    0,  370,
+      368,  384,  370,  373,  368,  393,  375,  391,  388,  397,
+      395,  396,  381,  400,  389,  407,  391,  392,  411,  412,
+      405,  407,  411,  426,  431,  433,  437,  438,  430,    0,
+      425,  429,  445,  442,  445,    0,  442,    0,  450,  451,
+      444,  438,  447,  455,  454,   61,  458,    0,  454,  456,
 
-      442,  453,  446,  472,  484,    0,  448,  456,  471,  468,
-      482,  474,  475,  471,    0,  472,  474,  483,  476,  478,
-      487,  496,  493,  491,    0,  488,  501,  487,  488,  500,
-        0,    0,  494,  499,  497,  498,  533,    0,    0,    0,
-        0,    0,  498,    0,  500,  506,  510,  533,    0,    0,
-      523,  523,  542,  546,  538,  547,  535,    0,  534,  536,
-      553,  551,  555,    0,  548,  568,  839,    0,  558,  561,
-      547,  565,    0,  557,  555,  569,  567,  576,  570,  581,
-      583,  579,  580,  593,  594,    0,    0,    0,  594,    0,
-      597,    0,  587,  603,  587,    0,    0,    0,    0,  592,
+      464,  465,  458,  475,  463,  469,  490,  476,  488,  482,
+      505,  511,    0,  485,  495,  505,  497,  499,  512,  503,
+      502,  496,    0,  497,  500,  500,  508,  503,  506,  514,
+      523,  521,  519,    0,  517,  529,  515,  516,  528,    0,
+        0,  532,  537,  528,  536,  540,  554,    0,    0,    0,
+        0,    0,  547,    0,  549,  551,  552,  570,    0,    0,
+      555,  554,  571,  573,  566,  574,  563,    0,  563,  565,
+      579,  583,  581,  586,    0,  579,  597,  900,    0,  591,
+      601,  589,  604,  609,    0,  602,  601,  617,  618,  616,
+      625,  615,  623,  620,  616,  617,  627,  628,    0,    0,
 
-      607,    0,  608,  594,  607,    0,  597,  613,  614,  601,
-      623,    0,  610,  617,  615,    0,  611,    0,  631,    0,
-      621,  623,  620,    0,  624,  646,  648,    0,  118,  638,
-        0,    0,  638,  656,  634,  648,  653,    0,  652,  666,
-        0,    0,    0,  650,  656,  657,    0,  667,  665,  670,
-        0,    0,  671,  668,  658,  663,    0,    0,  671,    0,
-      681,  678,  669,  677,    0,  672,  686,  680,  688,    0,
-      690,  695,    0,  690,    0,  709,  702,    0,  701,  712,
-        0,    0,  703,    0,  717,  707,  707,  719,    0,    0,
-        0,    0,  720,    0,  710,  718,  728,  727,  717,  717,
+        0,  627,    0,  629,    0,    0,  617,  635,  620,    0,
+        0,    0,    0,  625,  639,    0,  641,  627,  640,    0,
+      630,  648,  659,    0,  648,  667,    0,  655,  665,  663,
+        0,  671,  661,    0,  682,    0,  679,  672,  674,  667,
+        0,  668,  685,  687,    0,   57,  677,    0,    0,  674,
+      693,  670,  684,  688,    0,  687,  701,    0,    0,    0,
+      686,  691,  693,    0,  696,  706,  713,    0,  720,    0,
+        0,  721,  719,  712,  716,    0,    0,  726,    0,  736,
+      732,  722,  730,    0,  724,  738,  726,  729,  734,    0,
+      731,  736,    0,  732,    0,  748,  743,    0,  742,  751,
 
-        0,    0,  839,  781,  788,  795,  798,  804,  811,  817,
-      824,  831,  155,  147
+        0,  755,    0,  742,    0,  756,  747,  747,  760,    0,
+        0,  762,    0,    0,  774,    0,  764,    0,  772,  785,
+      786,  778,  778,    0,    0,  900,  842,  849,  856,  859,
+      865,  872,  878,  885,  892,   94,   90
     } ;
 
-static yyconst flex_int16_t yy_def[415] =
+static yyconst flex_int16_t yy_def[438] =
     {   0,
-      403,    1,  404,  404,  405,  405,  406,  406,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  403,  408,  403,  409,
-      410,  411,  403,  403,  403,  412,  403,  403,  403,  403,
-      403,  403,  403,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  403,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
+      426,    1,  427,  427,  428,  428,  429,  429,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  426,  431,  426,  432,
+      433,  434,  426,  426,  426,  435,  426,  426,  426,  426,
+      426,  426,  426,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  426,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
 
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  408,
-      403,  409,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  413,  411,  403,  412,  403,  403,  403,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  431,  426,  432,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  436,  434,  426,  435,  426,  426,
+      426,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
 
-      407,  407,  407,  403,  403,  414,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  403,  403,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      426,  426,  437,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  426,  426,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
 
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
-      407,  407,  407,  407,  407,  407,  407,  407,  407,  407,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
 
-      407,  407,    0,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,  430,  430,  430,  430,  430,
+      430,  430,  430,  430,  430,    0,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426
     } ;
 
-static yyconst flex_int16_t yy_nxt[910] =
+static yyconst flex_int16_t yy_nxt[971] =
     {   0,
        10,   11,   12,   11,   13,   14,   15,   16,   15,   17,
        18,   19,   19,   20,   21,   22,   23,   24,   25,   26,
@@ -580,102 +586,108 @@
        46,   35,   47,   10,   10,   23,   24,   25,   26,   27,
        28,   29,   30,   31,   32,   33,   34,   35,   36,   37,
        38,   39,   40,   41,   42,   43,   44,   45,   35,   46,
-       49,   49,   54,   80,   54,   57,   57,   58,   59,   59,
-       61,   62,   65,   88,   69,   89,   72,   60,   70,   90,
-       66,   75,   67,   73,   91,   76,   74,   68,   92,   77,
+       49,   49,   54,   90,   54,   57,   57,   58,   59,   59,
+       61,   62,   65,   82,   69,   91,   94,   60,   70,   73,
+       66,   71,   67,   95,  278,  106,   74,   68,  213,   75,
 
-       81,   93,  204,  205,   71,   78,   51,   51,   79,  205,
-      205,   65,   88,   69,   89,   72,   60,   70,   90,   66,
-       75,   67,   73,   91,   76,   74,   68,   92,   77,   81,
-       93,   94,  100,   71,   78,   95,   98,   79,   82,   96,
-      101,  104,   99,  105,  102,   97,   83,  103,  109,   84,
-      116,  267,   85,  106,  119,   86,  110,  107,   87,  206,
-       94,  100,  356,  108,   95,   98,  139,   82,   96,  101,
-      104,   99,  105,  102,   97,   83,  103,  109,   84,  116,
-      111,   85,  106,  119,   86,  110,  107,   87,  112,  114,
-      142,  115,  108,  117,  118,  139,   54,  113,   54,   57,
+       76,  375,   90,  107,   72,  263,   51,   51,  211,  212,
+       83,   65,  119,   69,   91,   94,   60,   70,   73,   66,
+       71,   67,   95,   77,  106,   74,   68,   78,   75,   76,
+       92,   79,  107,   72,   96,   93,  122,   80,   97,   83,
+       81,  119,   98,  142,  100,  120,  121,   54,   99,   54,
+      101,  137,   77,  124,  140,  140,   78,  141,  141,   92,
+       79,  212,  212,   96,   93,  122,   80,   97,  102,   81,
+       84,   98,  142,  100,  120,  121,  103,   99,   85,  101,
+      104,   86,  108,  105,   87,  111,  109,   88,   63,  116,
+       89,  117,  110,  112,  118,   57,   57,  102,  143,   84,
 
-       57,  136,  136,   58,   59,   59,  138,  138,   60,  111,
-       60,  137,  137,   60,  138,  138,  253,  112,  114,  142,
-      115,  140,  117,  118,  134,  143,  113,  124,  121,  141,
-       63,  144,  152,  145,   56,  125,  126,   60,  153,   60,
-      147,  127,   60,  158,  148,  128,  146,  149,   55,  150,
-      140,  151,  159,  129,  143,  403,  160,  130,  141,  131,
-      144,  152,  145,  132,  161,  162,  163,  153,  154,  147,
-      127,  155,  158,  148,  128,  146,  149,  156,  150,  164,
-      151,  159,  129,  165,  157,  160,  130,  166,  131,  167,
-      168,  169,  132,  161,  162,  163,  170,  154,  173,  174,
+      113,  141,  141,   56,   60,  103,  144,   85,  114,  104,
+       86,  108,  105,   87,  111,  109,   88,  115,  116,   89,
+      117,  110,  112,  118,  145,  139,  139,  143,  146,  113,
+       58,   59,   59,   60,   60,  144,   55,  114,  147,  148,
+       60,  150,  156,  157,  426,  151,  115,  127,   53,  152,
+       53,  158,  149,  145,   49,  128,  129,  146,  153,  163,
+      154,  130,  155,   60,  164,  131,   49,  147,  148,   60,
+      150,  156,  157,  132,  151,  426,  165,  133,  152,  134,
+      158,  149,  426,  135,  166,  167,  168,  153,  163,  154,
+      130,  155,  169,  164,  131,  159,  170,  171,  160,  172,
 
-      155,  171,  172,  175,  176,  177,  156,  178,  164,  179,
-      180,  181,  165,  157,  182,  183,  166,  184,  167,  168,
-      169,  185,  186,  189,  187,  170,  190,  173,  174,  188,
-      171,  172,  175,  176,  177,  193,  178,  191,  179,  180,
-      181,  194,  195,  182,  183,  192,  184,  196,  197,  198,
-      185,  186,  189,  187,  199,  190,  201,  202,  188,  203,
-      200,  138,  138,  207,  193,  208,  191,  209,  210,  211,
-      194,  195,  136,  136,  192,  212,  196,  197,  198,  213,
-      214,   60,  215,  199,  216,  201,  202,  217,  203,  200,
-      218,  219,  207,  222,  208,  220,  209,  210,  211,  221,
+      173,  174,  132,  179,  161,  165,  133,  175,  134,  180,
+      181,  162,  135,  166,  167,  168,  182,  176,  183,  185,
+      184,  169,  177,  178,  159,  170,  171,  160,  172,  173,
+      174,  186,  179,  161,  187,  188,  175,  189,  180,  181,
+      162,  190,  191,  192,  195,  182,  176,  183,  185,  184,
+      193,  177,  178,  196,  197,  194,  199,  200,  201,  202,
+      186,  203,  198,  187,  188,  204,  189,  205,  206,  208,
+      190,  191,  192,  195,  207,  209,  210,  141,  141,  193,
+      139,  139,  196,  197,  194,  199,  200,  201,  202,   60,
+      203,  198,  214,  215,  204,  216,  205,  206,  208,  217,
 
-      223,  224,  225,  226,  212,  227,  228,  229,  213,  214,
-       60,  215,  230,  216,  231,  232,  217,  233,  234,  218,
-      219,  235,  222,  236,  220,  239,  240,  237,  221,  223,
-      224,  225,  226,  241,  227,  228,  229,  238,  242,  243,
-      244,  230,  245,  231,  232,  246,  233,  234,  247,  248,
-      235,  249,  236,  250,  239,  240,  237,  251,  252,  254,
-      255,  256,  241,  257,  258,  259,  238,  242,  243,  244,
-      260,  245,  261,  262,  246,  263,  264,  247,  248,  265,
-      249,  268,  250,  266,  205,  269,  251,  252,  254,  255,
-      256,  270,  257,  258,  259,  205,  205,  271,  272,  260,
+      218,  219,  220,  207,  209,  210,  221,  222,  223,  224,
+      225,  226,  227,  228,  231,  229,  232,  233,   60,  230,
+      234,  214,  215,  235,  216,  236,  237,  238,  217,  218,
+      219,  220,  239,  240,  241,  221,  222,  223,  224,  225,
+      226,  227,  228,  231,  229,  232,  233,  242,  230,  234,
+      243,  244,  235,  245,  236,  237,  238,  246,  247,  249,
+      250,  239,  240,  241,  251,  252,  253,  254,  248,  255,
+      256,  257,  258,  259,  260,  261,  242,  262,  264,  243,
+      244,  265,  245,  266,  267,  268,  246,  247,  249,  250,
+      269,  270,  271,  251,  252,  253,  254,  248,  255,  256,
 
-      273,  261,  262,  274,  263,  264,  275,  276,  265,  277,
-      268,  278,  279,  280,  269,  281,  282,  283,  284,  285,
-      270,  286,  287,  288,  289,  290,  271,  272,  291,  273,
-      292,  293,  274,  296,  297,  275,  276,   53,  277,  298,
-      278,  279,  280,  299,  281,  282,  283,  284,  285,  300,
-      286,  287,  288,  289,  290,  294,  301,  291,  302,  292,
-      293,  303,  296,  297,  304,  305,  295,  306,  298,  307,
-      308,  309,  299,  310,  311,  312,  313,  314,  300,  205,
-      205,  315,  316,  317,  294,  301,  318,  302,  319,  320,
-      303,  321,  322,  304,  305,  295,  306,  323,  307,  308,
+      257,  258,  259,  260,  261,  272,  262,  264,  273,  274,
+      265,  275,  266,  267,  268,  276,  277,  212,  279,  269,
+      270,  271,  212,  212,  280,  281,  282,  283,  284,  285,
+      286,  287,  288,  289,  272,  290,  291,  273,  274,  292,
+      275,  293,  294,  295,  276,  296,  297,  279,  298,  299,
+      300,  301,  302,  280,  281,  282,  283,  284,  285,  286,
+      287,  288,  289,  303,  290,  291,  304,  305,  292,  306,
+      293,  294,  295,  307,  296,  297,  308,  298,  299,  300,
+      301,  302,  310,  311,  312,  313,  314,  309,  315,  316,
+      317,  318,  303,  319,  320,  304,  305,  321,  306,  322,
 
-      309,  324,  310,  311,  312,  313,  314,  325,  326,  327,
-      315,  316,  317,  328,  329,  318,  330,  319,  320,  331,
-      321,  322,  332,  333,  334,  335,  323,  336,  337,  338,
-      324,  339,  340,  341,  342,  343,  325,  326,  327,  344,
-      345,  346,  328,  329,  347,  330,  348,  349,  331,  350,
-      351,  332,  333,  334,  335,  352,  336,  337,  338,  353,
-      339,  340,  341,  342,  343,  354,  355,  357,  344,  345,
-      346,  358,  359,  347,  360,  348,  349,  361,  350,  351,
-      362,  363,  364,  365,  352,  366,  367,  368,  353,  369,
-      370,  371,  372,  373,  354,  355,  357,  374,  375,  376,
+      323,  324,  307,  325,  326,  308,  327,  328,  212,  212,
+      329,  310,  311,  312,  313,  314,  309,  315,  316,  317,
+      318,  330,  319,  320,  331,  332,  321,  333,  322,  323,
+      324,  334,  325,  326,  335,  327,  328,  336,  337,  329,
+      338,  339,  340,  341,  342,  343,  344,  345,  346,  347,
+      330,  348,  349,  331,  332,  350,  333,  351,  352,  353,
+      334,  354,  355,  335,  356,  357,  336,  337,  358,  338,
+      339,  340,  341,  342,  343,  344,  345,  346,  347,  359,
+      348,  349,  360,  361,  350,  362,  351,  352,  353,  363,
+      354,  355,  364,  356,  357,  365,  366,  358,  367,  368,
 
-      358,  359,  377,  360,  378,  379,  361,  380,  381,  362,
-      363,  364,  365,  382,  366,  367,  368,  383,  369,  370,
-      371,  372,  373,  384,  385,  386,  374,  375,  376,  387,
-      388,  377,  389,  378,  379,  390,  380,  381,  391,  392,
-      393,  394,  382,  395,  396,  397,  383,  398,  399,  400,
-      401,  402,  384,  385,  386,   53,   49,   49,  387,  388,
-      403,  389,  403,  403,  390,  403,  403,  391,  392,  393,
-      394,  403,  395,  396,  397,  403,  398,  399,  400,  401,
-      402,   48,   48,   48,   48,   48,   48,   48,   50,   50,
-       50,   50,   50,   50,   50,   52,   52,   52,   52,   52,
+      369,  370,  371,  372,  373,  374,  376,  377,  359,  378,
+      379,  360,  361,  380,  362,  381,  382,  383,  363,  384,
+      385,  364,  386,  387,  365,  366,  388,  367,  368,  369,
+      370,  371,  372,  373,  374,  376,  377,  389,  378,  379,
+      390,  391,  380,  392,  381,  382,  383,  393,  384,  385,
+      394,  386,  387,  395,  396,  388,  397,  398,  399,  400,
+      401,  402,  403,  404,  405,  406,  389,  407,  408,  390,
+      391,  409,  392,  410,  411,  412,  393,  413,  414,  394,
+      415,  416,  395,  396,  417,  397,  398,  399,  400,  401,
+      402,  403,  404,  405,  406,  418,  407,  408,  419,  420,
 
-       52,   52,   64,   64,  120,  120,  120,  403,  120,  120,
-      120,  122,  122,  122,  403,  122,  122,  123,  123,  123,
-      123,  123,  123,  123,  133,  133,  403,  133,  133,  133,
-      133,  135,  403,  135,  135,  135,  135,  135,    9,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      409,  421,  410,  411,  412,  422,  413,  414,  423,  415,
+      416,  424,  425,  417,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  418,  426,  426,  419,  420,  426,
+      421,  426,  426,  426,  422,  426,  426,  423,  426,  426,
+      424,  425,   48,   48,   48,   48,   48,   48,   48,   50,
+       50,   50,   50,   50,   50,   50,   52,   52,   52,   52,
+       52,   52,   52,   64,   64,  123,  123,  123,  426,  123,
+      123,  123,  125,  125,  125,  426,  125,  125,  126,  126,
+      126,  126,  126,  126,  126,  136,  136,  426,  136,  136,
+      136,  136,  138,  426,  138,  138,  138,  138,  138,    9,
 
-      403,  403,  403,  403,  403,  403,  403,  403,  403
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426
     } ;
 
-static yyconst flex_int16_t yy_chk[910] =
+static yyconst flex_int16_t yy_chk[971] =
     {   0,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
@@ -684,110 +696,117 @@
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
         1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
-        5,    6,   11,   27,   11,   18,   18,   19,   19,   19,
-       20,   20,   23,   29,   24,   30,   25,   19,   24,   31,
-       23,   26,   23,   25,   31,   26,   25,   23,   32,   26,
+        5,    6,   11,   29,   11,   18,   18,   19,   19,   19,
+       20,   20,   23,   27,   24,   30,   32,   19,   24,   25,
+       23,   24,   23,   33,  437,   38,   25,   23,  436,   25,
 
-       27,   33,  125,  125,   24,   26,    5,    6,   26,  126,
-      126,   23,   29,   24,   30,   25,   19,   24,   31,   23,
-       26,   23,   25,   31,   26,   25,   23,   32,   26,   27,
-       33,   34,   37,   24,   26,   34,   36,   26,   28,   34,
-       37,   38,   36,   39,   37,   34,   28,   37,   41,   28,
-       44,  414,   28,   40,   46,   28,   41,   40,   28,  413,
-       34,   37,  329,   40,   34,   36,   65,   28,   34,   37,
-       38,   36,   39,   37,   34,   28,   37,   41,   28,   44,
-       42,   28,   40,   46,   28,   41,   40,   28,   42,   43,
-       67,   43,   40,   45,   45,   65,   54,   42,   54,   57,
+       25,  346,   29,   39,   24,  196,    5,    6,  128,  128,
+       27,   23,   44,   24,   30,   32,   19,   24,   25,   23,
+       24,   23,   33,   26,   38,   25,   23,   26,   25,   25,
+       31,   26,   39,   24,   34,   31,   46,   26,   34,   27,
+       26,   44,   34,   65,   36,   45,   45,   54,   34,   54,
+       36,   53,   26,   49,   60,   60,   26,   60,   60,   31,
+       26,  129,  129,   34,   31,   46,   26,   34,   37,   26,
+       28,   34,   65,   36,   45,   45,   37,   34,   28,   36,
+       37,   28,   40,   37,   28,   41,   40,   28,   22,   43,
+       28,   43,   40,   41,   43,   57,   57,   37,   66,   28,
 
-       57,   58,   58,   59,   59,   59,  137,  137,   57,   42,
-       58,   60,   60,   59,   60,   60,  190,   42,   43,   67,
-       43,   66,   45,   45,   53,   68,   42,   51,   49,   66,
-       22,   69,   74,   70,   17,   51,   51,   57,   75,   58,
-       72,   51,   59,   77,   72,   51,   70,   73,   13,   73,
-       66,   73,   78,   51,   68,    9,   79,   51,   66,   51,
-       69,   74,   70,   51,   81,   82,   83,   75,   76,   72,
-       51,   76,   77,   72,   51,   70,   73,   76,   73,   84,
-       73,   78,   51,   85,   76,   79,   51,   86,   51,   87,
-       88,   89,   51,   81,   82,   83,   90,   76,   92,   93,
+       42,  140,  140,   17,   57,   37,   66,   28,   42,   37,
+       28,   40,   37,   28,   41,   40,   28,   42,   43,   28,
+       43,   40,   41,   43,   67,   58,   58,   66,   68,   42,
+       59,   59,   59,   57,   58,   66,   13,   42,   69,   70,
+       59,   71,   75,   76,    9,   73,   42,   51,    8,   73,
+        7,   77,   70,   67,    4,   51,   51,   68,   74,   79,
+       74,   51,   74,   58,   80,   51,    3,   69,   70,   59,
+       71,   75,   76,   51,   73,    0,   81,   51,   73,   51,
+       77,   70,    0,   51,   83,   84,   85,   74,   79,   74,
+       51,   74,   86,   80,   51,   78,   87,   88,   78,   89,
 
-       76,   90,   90,   94,   95,   96,   76,   96,   84,   97,
-       98,   99,   85,   76,  100,  102,   86,  103,   87,   88,
-       89,  104,  105,  107,  106,   90,  108,   92,   93,  106,
-       90,   90,   94,   95,   96,  110,   96,  109,   97,   98,
-       99,  111,  112,  100,  102,  109,  103,  113,  114,  115,
-      104,  105,  107,  106,  116,  108,  117,  118,  106,  119,
-      116,  138,  138,  141,  110,  143,  109,  144,  145,  147,
-      111,  112,  136,  136,  109,  148,  113,  114,  115,  149,
-      150,  136,  151,  116,  152,  117,  118,  153,  119,  116,
-      154,  155,  141,  157,  143,  156,  144,  145,  147,  156,
+       90,   91,   51,   94,   78,   81,   51,   92,   51,   95,
+       96,   78,   51,   83,   84,   85,   97,   92,   98,   99,
+       98,   86,   92,   92,   78,   87,   88,   78,   89,   90,
+       91,  100,   94,   78,  101,  102,   92,  104,   95,   96,
+       78,  105,  106,  107,  109,   97,   92,   98,   99,   98,
+      108,   92,   92,  110,  111,  108,  112,  113,  114,  115,
+      100,  116,  111,  101,  102,  117,  104,  118,  119,  120,
+      105,  106,  107,  109,  119,  121,  122,  141,  141,  108,
+      139,  139,  110,  111,  108,  112,  113,  114,  115,  139,
+      116,  111,  144,  146,  117,  147,  118,  119,  120,  148,
 
-      158,  159,  160,  161,  148,  162,  163,  164,  149,  150,
-      136,  151,  165,  152,  166,  167,  153,  168,  169,  154,
-      155,  170,  157,  171,  156,  173,  175,  172,  156,  158,
-      159,  160,  161,  176,  162,  163,  164,  172,  177,  178,
-      179,  165,  181,  166,  167,  183,  168,  169,  184,  185,
-      170,  186,  171,  187,  173,  175,  172,  188,  189,  191,
-      193,  194,  176,  195,  196,  197,  172,  177,  178,  179,
-      198,  181,  199,  200,  183,  201,  202,  184,  185,  203,
-      186,  207,  187,  204,  204,  208,  188,  189,  191,  193,
-      194,  209,  195,  196,  197,  205,  205,  210,  211,  198,
+      150,  151,  152,  119,  121,  122,  153,  154,  155,  156,
+      157,  158,  159,  160,  162,  161,  163,  164,  139,  161,
+      165,  144,  146,  166,  147,  167,  168,  169,  148,  150,
+      151,  152,  170,  171,  172,  153,  154,  155,  156,  157,
+      158,  159,  160,  162,  161,  163,  164,  173,  161,  165,
+      174,  175,  166,  176,  167,  168,  169,  177,  178,  179,
+      181,  170,  171,  172,  182,  183,  184,  185,  178,  187,
+      189,  190,  191,  192,  193,  194,  173,  195,  197,  174,
+      175,  199,  176,  200,  201,  202,  177,  178,  179,  181,
+      203,  204,  205,  182,  183,  184,  185,  178,  187,  189,
 
-      212,  199,  200,  213,  201,  202,  214,  216,  203,  217,
-      207,  218,  219,  220,  208,  221,  222,  223,  224,  226,
-      209,  227,  228,  229,  230,  233,  210,  211,  234,  212,
-      235,  236,  213,  243,  245,  214,  216,    8,  217,  246,
-      218,  219,  220,  247,  221,  222,  223,  224,  226,  248,
-      227,  228,  229,  230,  233,  237,  251,  234,  252,  235,
-      236,  253,  243,  245,  254,  255,  237,  256,  246,  257,
-      259,  260,  247,  261,  262,  263,  265,  269,  248,  266,
-      266,  270,  271,  272,  237,  251,  274,  252,  275,  276,
-      253,  277,  278,  254,  255,  237,  256,  279,  257,  259,
+      190,  191,  192,  193,  194,  206,  195,  197,  207,  208,
+      199,  209,  200,  201,  202,  210,  211,  211,  214,  203,
+      204,  205,  212,  212,  215,  216,  217,  218,  219,  220,
+      221,  222,  224,  225,  206,  226,  227,  207,  208,  228,
+      209,  229,  230,  231,  210,  232,  233,  214,  235,  236,
+      237,  238,  239,  215,  216,  217,  218,  219,  220,  221,
+      222,  224,  225,  242,  226,  227,  243,  244,  228,  245,
+      229,  230,  231,  246,  232,  233,  247,  235,  236,  237,
+      238,  239,  253,  255,  256,  257,  258,  247,  261,  262,
+      263,  264,  242,  265,  266,  243,  244,  267,  245,  269,
 
-      260,  280,  261,  262,  263,  265,  269,  281,  282,  283,
-      270,  271,  272,  284,  285,  274,  289,  275,  276,  291,
-      277,  278,  293,  294,  295,  300,  279,  301,  303,  304,
-      280,  305,  307,  308,  309,  310,  281,  282,  283,  311,
-      313,  314,  284,  285,  315,  289,  317,  319,  291,  321,
-      322,  293,  294,  295,  300,  323,  301,  303,  304,  325,
-      305,  307,  308,  309,  310,  326,  327,  330,  311,  313,
-      314,  333,  334,  315,  335,  317,  319,  336,  321,  322,
-      337,  339,  340,  344,  323,  345,  346,  348,  325,  349,
-      350,  353,  354,  355,  326,  327,  330,  356,  359,  361,
+      270,  271,  246,  272,  273,  247,  274,  276,  277,  277,
+      280,  253,  255,  256,  257,  258,  247,  261,  262,  263,
+      264,  281,  265,  266,  282,  283,  267,  284,  269,  270,
+      271,  286,  272,  273,  287,  274,  276,  288,  289,  280,
+      290,  291,  292,  293,  294,  295,  296,  297,  298,  302,
+      281,  304,  307,  282,  283,  308,  284,  309,  314,  315,
+      286,  317,  318,  287,  319,  321,  288,  289,  322,  290,
+      291,  292,  293,  294,  295,  296,  297,  298,  302,  323,
+      304,  307,  325,  326,  308,  328,  309,  314,  315,  329,
+      317,  318,  330,  319,  321,  332,  333,  322,  335,  337,
 
-      333,  334,  362,  335,  363,  364,  336,  366,  367,  337,
-      339,  340,  344,  368,  345,  346,  348,  369,  349,  350,
-      353,  354,  355,  371,  372,  374,  356,  359,  361,  376,
-      377,  362,  379,  363,  364,  380,  366,  367,  383,  385,
-      386,  387,  368,  388,  393,  395,  369,  396,  397,  398,
-      399,  400,  371,  372,  374,    7,    4,    3,  376,  377,
-        0,  379,    0,    0,  380,    0,    0,  383,  385,  386,
-      387,    0,  388,  393,  395,    0,  396,  397,  398,  399,
-      400,  404,  404,  404,  404,  404,  404,  404,  405,  405,
-      405,  405,  405,  405,  405,  406,  406,  406,  406,  406,
+      338,  339,  340,  342,  343,  344,  347,  350,  323,  351,
+      352,  325,  326,  353,  328,  354,  356,  357,  329,  361,
+      362,  330,  363,  365,  332,  333,  366,  335,  337,  338,
+      339,  340,  342,  343,  344,  347,  350,  367,  351,  352,
+      369,  372,  353,  373,  354,  356,  357,  374,  361,  362,
+      375,  363,  365,  378,  380,  366,  381,  382,  383,  385,
+      386,  387,  388,  389,  391,  392,  367,  394,  396,  369,
+      372,  397,  373,  399,  400,  402,  374,  404,  406,  375,
+      407,  408,  378,  380,  409,  381,  382,  383,  385,  386,
+      387,  388,  389,  391,  392,  412,  394,  396,  415,  417,
 
-      406,  406,  407,  407,  408,  408,  408,    0,  408,  408,
-      408,  409,  409,  409,    0,  409,  409,  410,  410,  410,
-      410,  410,  410,  410,  411,  411,    0,  411,  411,  411,
-      411,  412,    0,  412,  412,  412,  412,  412,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
-      403,  403,  403,  403,  403,  403,  403,  403,  403,  403,
+      397,  419,  399,  400,  402,  420,  404,  406,  421,  407,
+      408,  422,  423,  409,    0,    0,    0,    0,    0,    0,
+        0,    0,    0,    0,  412,    0,    0,  415,  417,    0,
+      419,    0,    0,    0,  420,    0,    0,  421,    0,    0,
+      422,  423,  427,  427,  427,  427,  427,  427,  427,  428,
+      428,  428,  428,  428,  428,  428,  429,  429,  429,  429,
+      429,  429,  429,  430,  430,  431,  431,  431,    0,  431,
+      431,  431,  432,  432,  432,    0,  432,  432,  433,  433,
+      433,  433,  433,  433,  433,  434,  434,    0,  434,  434,
+      434,  434,  435,    0,  435,  435,  435,  435,  435,  426,
 
-      403,  403,  403,  403,  403,  403,  403,  403,  403
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426,
+      426,  426,  426,  426,  426,  426,  426,  426,  426,  426
     } ;
 
 /* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[117] =
+static yyconst flex_int32_t yy_rule_can_match_eol[121] =
     {   0,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
     0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
-    0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0,     };
+    0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 
+    0,     };
 
 /* The intent behind this definition is that it'll catch
  * any uses of REJECT which flex missed.
@@ -838,6 +857,10 @@
 class ParseFunctionCall;
 class ParseGroupBy;
 class ParseHaving;
+class ParseKeyValue;
+class ParseKeyStringValue;
+class ParseKeyStringList;
+class ParseKeyLiteralValue;
 class ParseLimit;
 class ParseOrderBy;
 class ParseOrderByItem;
@@ -849,6 +872,7 @@
 class ParseSelectionItemScalar;
 class ParseSelectionList;
 class ParseSimpleTableReference;
+class ParseStringKeyLiteralValues;
 class ParseStatement;
 class ParseStatementCopyFrom;
 class ParseStatementCreateTable;
@@ -887,7 +911,7 @@
 
 
 
-#line 891 "SqlLexer_gen.cpp"
+#line 915 "SqlLexer_gen.cpp"
 
 #define INITIAL 0
 #define CONDITION_STRING_SINGLE_QUOTED 1
@@ -1164,10 +1188,10 @@
 		}
 
 	{
-#line 111 "../SqlLexer.lpp"
+#line 116 "../SqlLexer.lpp"
 
 
-#line 1171 "SqlLexer_gen.cpp"
+#line 1195 "SqlLexer_gen.cpp"
 
 	while ( 1 )		/* loops until end-of-file is reached */
 		{
@@ -1194,13 +1218,13 @@
 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 				{
 				yy_current_state = (int) yy_def[yy_current_state];
-				if ( yy_current_state >= 404 )
+				if ( yy_current_state >= 427 )
 					yy_c = yy_meta[(unsigned int) yy_c];
 				}
 			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
 			++yy_cp;
 			}
-		while ( yy_current_state != 403 );
+		while ( yy_current_state != 426 );
 		yy_cp = yyg->yy_last_accepting_cpos;
 		yy_current_state = yyg->yy_last_accepting_state;
 
@@ -1234,472 +1258,492 @@
 
 case 1:
 YY_RULE_SETUP
-#line 113 "../SqlLexer.lpp"
+#line 118 "../SqlLexer.lpp"
 return TOKEN_ADD;
 	YY_BREAK
 case 2:
 YY_RULE_SETUP
-#line 114 "../SqlLexer.lpp"
+#line 119 "../SqlLexer.lpp"
 return TOKEN_ALL;
 	YY_BREAK
 case 3:
 YY_RULE_SETUP
-#line 115 "../SqlLexer.lpp"
+#line 120 "../SqlLexer.lpp"
 return TOKEN_ALTER;
 	YY_BREAK
 case 4:
 YY_RULE_SETUP
-#line 116 "../SqlLexer.lpp"
+#line 121 "../SqlLexer.lpp"
 return TOKEN_AND;
 	YY_BREAK
 case 5:
 YY_RULE_SETUP
-#line 117 "../SqlLexer.lpp"
+#line 122 "../SqlLexer.lpp"
 return TOKEN_AS;
 	YY_BREAK
 case 6:
 YY_RULE_SETUP
-#line 118 "../SqlLexer.lpp"
+#line 123 "../SqlLexer.lpp"
 return TOKEN_ASC;
 	YY_BREAK
 case 7:
 YY_RULE_SETUP
-#line 119 "../SqlLexer.lpp"
+#line 124 "../SqlLexer.lpp"
 return TOKEN_ASC;
 	YY_BREAK
 case 8:
 YY_RULE_SETUP
-#line 120 "../SqlLexer.lpp"
+#line 125 "../SqlLexer.lpp"
 return TOKEN_BETWEEN;
 	YY_BREAK
 case 9:
 YY_RULE_SETUP
-#line 121 "../SqlLexer.lpp"
+#line 126 "../SqlLexer.lpp"
 return TOKEN_BIGINT;
 	YY_BREAK
 case 10:
 YY_RULE_SETUP
-#line 122 "../SqlLexer.lpp"
+#line 127 "../SqlLexer.lpp"
 return TOKEN_BIT;
 	YY_BREAK
 case 11:
 YY_RULE_SETUP
-#line 123 "../SqlLexer.lpp"
-return TOKEN_BY;
+#line 128 "../SqlLexer.lpp"
+return TOKEN_BLOOM_FILTER;
 	YY_BREAK
 case 12:
 YY_RULE_SETUP
-#line 124 "../SqlLexer.lpp"
-return TOKEN_CHARACTER;
+#line 129 "../SqlLexer.lpp"
+return TOKEN_CSB_TREE;
 	YY_BREAK
 case 13:
 YY_RULE_SETUP
-#line 125 "../SqlLexer.lpp"
-return TOKEN_CHARACTER;
+#line 130 "../SqlLexer.lpp"
+return TOKEN_BY;
 	YY_BREAK
 case 14:
 YY_RULE_SETUP
-#line 126 "../SqlLexer.lpp"
-return TOKEN_CHECK;
+#line 131 "../SqlLexer.lpp"
+return TOKEN_CHARACTER;
 	YY_BREAK
 case 15:
 YY_RULE_SETUP
-#line 127 "../SqlLexer.lpp"
-return TOKEN_COLUMN;
+#line 132 "../SqlLexer.lpp"
+return TOKEN_CHARACTER;
 	YY_BREAK
 case 16:
 YY_RULE_SETUP
-#line 128 "../SqlLexer.lpp"
-return TOKEN_CONSTRAINT;
+#line 133 "../SqlLexer.lpp"
+return TOKEN_CHECK;
 	YY_BREAK
 case 17:
 YY_RULE_SETUP
-#line 129 "../SqlLexer.lpp"
-return TOKEN_COPY;
+#line 134 "../SqlLexer.lpp"
+return TOKEN_COLUMN;
 	YY_BREAK
 case 18:
 YY_RULE_SETUP
-#line 130 "../SqlLexer.lpp"
-return TOKEN_CREATE;
+#line 135 "../SqlLexer.lpp"
+return TOKEN_CONSTRAINT;
 	YY_BREAK
 case 19:
 YY_RULE_SETUP
-#line 131 "../SqlLexer.lpp"
-return TOKEN_DATE;
+#line 136 "../SqlLexer.lpp"
+return TOKEN_COPY;
 	YY_BREAK
 case 20:
 YY_RULE_SETUP
-#line 132 "../SqlLexer.lpp"
-return TOKEN_DATETIME;
+#line 137 "../SqlLexer.lpp"
+return TOKEN_CREATE;
 	YY_BREAK
 case 21:
 YY_RULE_SETUP
-#line 133 "../SqlLexer.lpp"
-return TOKEN_DECIMAL;
+#line 138 "../SqlLexer.lpp"
+return TOKEN_DATE;
 	YY_BREAK
 case 22:
 YY_RULE_SETUP
-#line 134 "../SqlLexer.lpp"
-return TOKEN_DEFAULT;
+#line 139 "../SqlLexer.lpp"
+return TOKEN_DATETIME;
 	YY_BREAK
 case 23:
 YY_RULE_SETUP
-#line 135 "../SqlLexer.lpp"
-return TOKEN_DELETE;
+#line 140 "../SqlLexer.lpp"
+return TOKEN_DECIMAL;
 	YY_BREAK
 case 24:
 YY_RULE_SETUP
-#line 136 "../SqlLexer.lpp"
-return TOKEN_DELIMITER;
+#line 141 "../SqlLexer.lpp"
+return TOKEN_DEFAULT;
 	YY_BREAK
 case 25:
 YY_RULE_SETUP
-#line 137 "../SqlLexer.lpp"
-return TOKEN_DESC;
+#line 142 "../SqlLexer.lpp"
+return TOKEN_DELETE;
 	YY_BREAK
 case 26:
 YY_RULE_SETUP
-#line 138 "../SqlLexer.lpp"
-return TOKEN_DESC;
+#line 143 "../SqlLexer.lpp"
+return TOKEN_DELIMITER;
 	YY_BREAK
 case 27:
 YY_RULE_SETUP
-#line 139 "../SqlLexer.lpp"
-return TOKEN_DISTINCT;
+#line 144 "../SqlLexer.lpp"
+return TOKEN_DESC;
 	YY_BREAK
 case 28:
 YY_RULE_SETUP
-#line 140 "../SqlLexer.lpp"
-return TOKEN_DOUBLE;
+#line 145 "../SqlLexer.lpp"
+return TOKEN_DESC;
 	YY_BREAK
 case 29:
 YY_RULE_SETUP
-#line 141 "../SqlLexer.lpp"
-return TOKEN_DROP;
+#line 146 "../SqlLexer.lpp"
+return TOKEN_DISTINCT;
 	YY_BREAK
 case 30:
 YY_RULE_SETUP
-#line 142 "../SqlLexer.lpp"
-return TOKEN_ESCAPE_STRINGS;
+#line 147 "../SqlLexer.lpp"
+return TOKEN_DOUBLE;
 	YY_BREAK
 case 31:
 YY_RULE_SETUP
-#line 143 "../SqlLexer.lpp"
-return TOKEN_FALSE;
+#line 148 "../SqlLexer.lpp"
+return TOKEN_DROP;
 	YY_BREAK
 case 32:
 YY_RULE_SETUP
-#line 144 "../SqlLexer.lpp"
-return TOKEN_FIRST;
+#line 149 "../SqlLexer.lpp"
+return TOKEN_ESCAPE_STRINGS;
 	YY_BREAK
 case 33:
 YY_RULE_SETUP
-#line 145 "../SqlLexer.lpp"
-return TOKEN_FLOAT;
+#line 150 "../SqlLexer.lpp"
+return TOKEN_FALSE;
 	YY_BREAK
 case 34:
 YY_RULE_SETUP
-#line 146 "../SqlLexer.lpp"
-return TOKEN_FOREIGN;
+#line 151 "../SqlLexer.lpp"
+return TOKEN_FIRST;
 	YY_BREAK
 case 35:
 YY_RULE_SETUP
-#line 147 "../SqlLexer.lpp"
-return TOKEN_FROM;
+#line 152 "../SqlLexer.lpp"
+return TOKEN_FLOAT;
 	YY_BREAK
 case 36:
 YY_RULE_SETUP
-#line 148 "../SqlLexer.lpp"
-return TOKEN_FULL;
+#line 153 "../SqlLexer.lpp"
+return TOKEN_FOREIGN;
 	YY_BREAK
 case 37:
 YY_RULE_SETUP
-#line 149 "../SqlLexer.lpp"
-return TOKEN_GROUP;
+#line 154 "../SqlLexer.lpp"
+return TOKEN_FROM;
 	YY_BREAK
 case 38:
 YY_RULE_SETUP
-#line 150 "../SqlLexer.lpp"
-return TOKEN_HAVING;
+#line 155 "../SqlLexer.lpp"
+return TOKEN_FULL;
 	YY_BREAK
 case 39:
 YY_RULE_SETUP
-#line 151 "../SqlLexer.lpp"
-return TOKEN_INNER;
+#line 156 "../SqlLexer.lpp"
+return TOKEN_GROUP;
 	YY_BREAK
 case 40:
 YY_RULE_SETUP
-#line 152 "../SqlLexer.lpp"
-return TOKEN_INSERT;
+#line 157 "../SqlLexer.lpp"
+return TOKEN_HAVING;
 	YY_BREAK
 case 41:
 YY_RULE_SETUP
-#line 153 "../SqlLexer.lpp"
-return TOKEN_INTEGER;
+#line 158 "../SqlLexer.lpp"
+return TOKEN_INDEX;
 	YY_BREAK
 case 42:
 YY_RULE_SETUP
-#line 154 "../SqlLexer.lpp"
-return TOKEN_INTEGER;
+#line 159 "../SqlLexer.lpp"
+return TOKEN_INNER;
 	YY_BREAK
 case 43:
 YY_RULE_SETUP
-#line 155 "../SqlLexer.lpp"
-return TOKEN_INTERVAL;
+#line 160 "../SqlLexer.lpp"
+return TOKEN_INSERT;
 	YY_BREAK
 case 44:
 YY_RULE_SETUP
-#line 156 "../SqlLexer.lpp"
-return TOKEN_INTO;
+#line 161 "../SqlLexer.lpp"
+return TOKEN_INTEGER;
 	YY_BREAK
 case 45:
 YY_RULE_SETUP
-#line 157 "../SqlLexer.lpp"
-return TOKEN_IS;
+#line 162 "../SqlLexer.lpp"
+return TOKEN_INTEGER;
 	YY_BREAK
 case 46:
 YY_RULE_SETUP
-#line 158 "../SqlLexer.lpp"
-return TOKEN_JOIN;
+#line 163 "../SqlLexer.lpp"
+return TOKEN_INTERVAL;
 	YY_BREAK
 case 47:
 YY_RULE_SETUP
-#line 159 "../SqlLexer.lpp"
-return TOKEN_KEY;
+#line 164 "../SqlLexer.lpp"
+return TOKEN_INTO;
 	YY_BREAK
 case 48:
 YY_RULE_SETUP
-#line 160 "../SqlLexer.lpp"
-return TOKEN_LAST;
+#line 165 "../SqlLexer.lpp"
+return TOKEN_IS;
 	YY_BREAK
 case 49:
 YY_RULE_SETUP
-#line 161 "../SqlLexer.lpp"
-return TOKEN_LEFT;
+#line 166 "../SqlLexer.lpp"
+return TOKEN_JOIN;
 	YY_BREAK
 case 50:
 YY_RULE_SETUP
-#line 162 "../SqlLexer.lpp"
-return TOKEN_LIKE;
+#line 167 "../SqlLexer.lpp"
+return TOKEN_KEY;
 	YY_BREAK
 case 51:
 YY_RULE_SETUP
-#line 163 "../SqlLexer.lpp"
-return TOKEN_LIMIT;
+#line 168 "../SqlLexer.lpp"
+return TOKEN_LAST;
 	YY_BREAK
 case 52:
 YY_RULE_SETUP
-#line 164 "../SqlLexer.lpp"
-return TOKEN_LONG;
+#line 169 "../SqlLexer.lpp"
+return TOKEN_LEFT;
 	YY_BREAK
 case 53:
 YY_RULE_SETUP
-#line 165 "../SqlLexer.lpp"
-return TOKEN_NOT;
+#line 170 "../SqlLexer.lpp"
+return TOKEN_LIKE;
 	YY_BREAK
 case 54:
 YY_RULE_SETUP
-#line 166 "../SqlLexer.lpp"
-return TOKEN_NULL;
+#line 171 "../SqlLexer.lpp"
+return TOKEN_LIMIT;
 	YY_BREAK
 case 55:
 YY_RULE_SETUP
-#line 167 "../SqlLexer.lpp"
-return TOKEN_NULLS;
+#line 172 "../SqlLexer.lpp"
+return TOKEN_LONG;
 	YY_BREAK
 case 56:
 YY_RULE_SETUP
-#line 168 "../SqlLexer.lpp"
-return TOKEN_OFF;
+#line 173 "../SqlLexer.lpp"
+return TOKEN_NOT;
 	YY_BREAK
 case 57:
 YY_RULE_SETUP
-#line 169 "../SqlLexer.lpp"
-return TOKEN_ON;
+#line 174 "../SqlLexer.lpp"
+return TOKEN_NULL;
 	YY_BREAK
 case 58:
 YY_RULE_SETUP
-#line 170 "../SqlLexer.lpp"
-return TOKEN_OR;
+#line 175 "../SqlLexer.lpp"
+return TOKEN_NULLS;
 	YY_BREAK
 case 59:
 YY_RULE_SETUP
-#line 171 "../SqlLexer.lpp"
-return TOKEN_ORDER;
+#line 176 "../SqlLexer.lpp"
+return TOKEN_OFF;
 	YY_BREAK
 case 60:
 YY_RULE_SETUP
-#line 172 "../SqlLexer.lpp"
-return TOKEN_OUTER;
+#line 177 "../SqlLexer.lpp"
+return TOKEN_ON;
 	YY_BREAK
 case 61:
 YY_RULE_SETUP
-#line 173 "../SqlLexer.lpp"
-return TOKEN_PRIMARY;
+#line 178 "../SqlLexer.lpp"
+return TOKEN_OR;
 	YY_BREAK
 case 62:
 YY_RULE_SETUP
-#line 174 "../SqlLexer.lpp"
-return TOKEN_QUIT;
+#line 179 "../SqlLexer.lpp"
+return TOKEN_ORDER;
 	YY_BREAK
 case 63:
 YY_RULE_SETUP
-#line 175 "../SqlLexer.lpp"
-return TOKEN_REAL;
+#line 180 "../SqlLexer.lpp"
+return TOKEN_OUTER;
 	YY_BREAK
 case 64:
 YY_RULE_SETUP
-#line 176 "../SqlLexer.lpp"
-return TOKEN_REFERENCES;
+#line 181 "../SqlLexer.lpp"
+return TOKEN_PRIMARY;
 	YY_BREAK
 case 65:
 YY_RULE_SETUP
-#line 177 "../SqlLexer.lpp"
-return TOKEN_RIGHT;
+#line 182 "../SqlLexer.lpp"
+return TOKEN_QUIT;
 	YY_BREAK
 case 66:
 YY_RULE_SETUP
-#line 178 "../SqlLexer.lpp"
-return TOKEN_ROW_DELIMITER;
+#line 183 "../SqlLexer.lpp"
+return TOKEN_REAL;
 	YY_BREAK
 case 67:
 YY_RULE_SETUP
-#line 179 "../SqlLexer.lpp"
-return TOKEN_SELECT;
+#line 184 "../SqlLexer.lpp"
+return TOKEN_REFERENCES;
 	YY_BREAK
 case 68:
 YY_RULE_SETUP
-#line 180 "../SqlLexer.lpp"
-return TOKEN_SET;
+#line 185 "../SqlLexer.lpp"
+return TOKEN_RIGHT;
 	YY_BREAK
 case 69:
 YY_RULE_SETUP
-#line 181 "../SqlLexer.lpp"
-return TOKEN_SMALLINT;
+#line 186 "../SqlLexer.lpp"
+return TOKEN_ROW_DELIMITER;
 	YY_BREAK
 case 70:
 YY_RULE_SETUP
-#line 182 "../SqlLexer.lpp"
-return TOKEN_TABLE;
+#line 187 "../SqlLexer.lpp"
+return TOKEN_SELECT;
 	YY_BREAK
 case 71:
 YY_RULE_SETUP
-#line 183 "../SqlLexer.lpp"
-return TOKEN_TIME;
+#line 188 "../SqlLexer.lpp"
+return TOKEN_SET;
 	YY_BREAK
 case 72:
 YY_RULE_SETUP
-#line 184 "../SqlLexer.lpp"
-return TOKEN_TIMESTAMP;
+#line 189 "../SqlLexer.lpp"
+return TOKEN_SMALLINT;
 	YY_BREAK
 case 73:
 YY_RULE_SETUP
-#line 185 "../SqlLexer.lpp"
-return TOKEN_TRUE;
+#line 190 "../SqlLexer.lpp"
+return TOKEN_TABLE;
 	YY_BREAK
 case 74:
 YY_RULE_SETUP
-#line 186 "../SqlLexer.lpp"
-return TOKEN_UNIQUE;
+#line 191 "../SqlLexer.lpp"
+return TOKEN_TIME;
 	YY_BREAK
 case 75:
 YY_RULE_SETUP
-#line 187 "../SqlLexer.lpp"
-return TOKEN_UPDATE;
+#line 192 "../SqlLexer.lpp"
+return TOKEN_TIMESTAMP;
 	YY_BREAK
 case 76:
 YY_RULE_SETUP
-#line 188 "../SqlLexer.lpp"
-return TOKEN_VALUES;
+#line 193 "../SqlLexer.lpp"
+return TOKEN_TRUE;
 	YY_BREAK
 case 77:
 YY_RULE_SETUP
-#line 189 "../SqlLexer.lpp"
-return TOKEN_VARCHAR;
+#line 194 "../SqlLexer.lpp"
+return TOKEN_UNIQUE;
 	YY_BREAK
 case 78:
 YY_RULE_SETUP
-#line 190 "../SqlLexer.lpp"
-return TOKEN_WHERE;
+#line 195 "../SqlLexer.lpp"
+return TOKEN_UPDATE;
 	YY_BREAK
 case 79:
 YY_RULE_SETUP
-#line 191 "../SqlLexer.lpp"
-return TOKEN_WITH;
+#line 196 "../SqlLexer.lpp"
+return TOKEN_USING;
 	YY_BREAK
 case 80:
 YY_RULE_SETUP
-#line 192 "../SqlLexer.lpp"
-return TOKEN_YEARMONTH;
+#line 197 "../SqlLexer.lpp"
+return TOKEN_VALUES;
 	YY_BREAK
 case 81:
 YY_RULE_SETUP
-#line 194 "../SqlLexer.lpp"
-return TOKEN_EQ;
+#line 198 "../SqlLexer.lpp"
+return TOKEN_VARCHAR;
 	YY_BREAK
 case 82:
 YY_RULE_SETUP
-#line 195 "../SqlLexer.lpp"
-return TOKEN_NEQ;
+#line 199 "../SqlLexer.lpp"
+return TOKEN_WHERE;
 	YY_BREAK
 case 83:
 YY_RULE_SETUP
-#line 196 "../SqlLexer.lpp"
-return TOKEN_NEQ;
+#line 200 "../SqlLexer.lpp"
+return TOKEN_WITH;
 	YY_BREAK
 case 84:
 YY_RULE_SETUP
-#line 197 "../SqlLexer.lpp"
-return TOKEN_LT;
+#line 201 "../SqlLexer.lpp"
+return TOKEN_YEARMONTH;
 	YY_BREAK
 case 85:
 YY_RULE_SETUP
-#line 198 "../SqlLexer.lpp"
-return TOKEN_GT;
+#line 203 "../SqlLexer.lpp"
+return TOKEN_EQ;
 	YY_BREAK
 case 86:
 YY_RULE_SETUP
-#line 199 "../SqlLexer.lpp"
-return TOKEN_LEQ;
+#line 204 "../SqlLexer.lpp"
+return TOKEN_NEQ;
 	YY_BREAK
 case 87:
 YY_RULE_SETUP
-#line 200 "../SqlLexer.lpp"
-return TOKEN_GEQ;
+#line 205 "../SqlLexer.lpp"
+return TOKEN_NEQ;
 	YY_BREAK
 case 88:
 YY_RULE_SETUP
-#line 202 "../SqlLexer.lpp"
-return yytext[0];
+#line 206 "../SqlLexer.lpp"
+return TOKEN_LT;
 	YY_BREAK
 case 89:
 YY_RULE_SETUP
-#line 203 "../SqlLexer.lpp"
+#line 207 "../SqlLexer.lpp"
+return TOKEN_GT;
+	YY_BREAK
+case 90:
+YY_RULE_SETUP
+#line 208 "../SqlLexer.lpp"
+return TOKEN_LEQ;
+	YY_BREAK
+case 91:
+YY_RULE_SETUP
+#line 209 "../SqlLexer.lpp"
+return TOKEN_GEQ;
+	YY_BREAK
+case 92:
+YY_RULE_SETUP
+#line 211 "../SqlLexer.lpp"
+return yytext[0];
+	YY_BREAK
+case 93:
+YY_RULE_SETUP
+#line 212 "../SqlLexer.lpp"
 return yytext[0];
 	YY_BREAK
 /**
   * Quoted strings. Prefacing a string with an 'e' or 'E' causes escape
   * sequences to be processed (as in PostgreSQL).
   **/
-case 90:
+case 94:
 YY_RULE_SETUP
-#line 209 "../SqlLexer.lpp"
+#line 218 "../SqlLexer.lpp"
 {
   yylval->string_value_ = new quickstep::ParseString(yylloc->first_line, yylloc->first_column);
   BEGIN(CONDITION_STRING_SINGLE_QUOTED_ESCAPED);
 }
 	YY_BREAK
-case 91:
+case 95:
 YY_RULE_SETUP
-#line 214 "../SqlLexer.lpp"
+#line 223 "../SqlLexer.lpp"
 {
   yylval->string_value_ = new quickstep::ParseString(yylloc->first_line, yylloc->first_column);
   BEGIN(CONDITION_STRING_SINGLE_QUOTED);
 }
 	YY_BREAK
-case 92:
+case 96:
 YY_RULE_SETUP
-#line 219 "../SqlLexer.lpp"
+#line 228 "../SqlLexer.lpp"
 {
   yylval->string_value_ = new quickstep::ParseString(yylloc->first_line, yylloc->first_column);
   BEGIN(CONDITION_STRING_DOUBLE_QUOTED);
@@ -1710,7 +1754,7 @@
 case YY_STATE_EOF(CONDITION_STRING_SINGLE_QUOTED):
 case YY_STATE_EOF(CONDITION_STRING_SINGLE_QUOTED_ESCAPED):
 case YY_STATE_EOF(CONDITION_STRING_DOUBLE_QUOTED):
-#line 226 "../SqlLexer.lpp"
+#line 235 "../SqlLexer.lpp"
 {
     delete yylval->string_value_;
     quickstep_yyerror(NULL, yyscanner, NULL, "unterminated string");
@@ -1721,9 +1765,9 @@
 
 /* Process escape sequences. */
 
-case 93:
+case 97:
 YY_RULE_SETUP
-#line 236 "../SqlLexer.lpp"
+#line 245 "../SqlLexer.lpp"
 {
     /* Octal code */
     unsigned int code;
@@ -1737,9 +1781,9 @@
     yylval->string_value_->push_back(code);
   }
 	YY_BREAK
-case 94:
+case 98:
 YY_RULE_SETUP
-#line 248 "../SqlLexer.lpp"
+#line 257 "../SqlLexer.lpp"
 {
     /* Hexadecimal code */
     unsigned int code;
@@ -1747,9 +1791,9 @@
     yylval->string_value_->push_back(code);
   }
 	YY_BREAK
-case 95:
+case 99:
 YY_RULE_SETUP
-#line 254 "../SqlLexer.lpp"
+#line 263 "../SqlLexer.lpp"
 {
     /* A numeric escape sequence that isn't correctly specified. */
     delete yylval->string_value_;
@@ -1758,58 +1802,58 @@
     return TOKEN_LEX_ERROR;
   }
 	YY_BREAK
-case 96:
+case 100:
 YY_RULE_SETUP
-#line 261 "../SqlLexer.lpp"
+#line 270 "../SqlLexer.lpp"
 {
     /* Backspace */
     yylval->string_value_->push_back('\b');
   }
 	YY_BREAK
-case 97:
+case 101:
 YY_RULE_SETUP
-#line 265 "../SqlLexer.lpp"
+#line 274 "../SqlLexer.lpp"
 {
     /* Form-feed */
     yylval->string_value_->push_back('\f');
   }
 	YY_BREAK
-case 98:
+case 102:
 YY_RULE_SETUP
-#line 269 "../SqlLexer.lpp"
+#line 278 "../SqlLexer.lpp"
 {
     /* Newline */
     yylval->string_value_->push_back('\n');
   }
 	YY_BREAK
-case 99:
+case 103:
 YY_RULE_SETUP
-#line 273 "../SqlLexer.lpp"
+#line 282 "../SqlLexer.lpp"
 {
     /* Carriage-return */
     yylval->string_value_->push_back('\r');
   }
 	YY_BREAK
-case 100:
+case 104:
 YY_RULE_SETUP
-#line 277 "../SqlLexer.lpp"
+#line 286 "../SqlLexer.lpp"
 {
     /* Horizontal Tab */
     yylval->string_value_->push_back('\t');
   }
 	YY_BREAK
-case 101:
-/* rule 101 can match eol */
+case 105:
+/* rule 105 can match eol */
 YY_RULE_SETUP
-#line 281 "../SqlLexer.lpp"
+#line 290 "../SqlLexer.lpp"
 {
     /* Any other character (including actual newline or carriage return) */
     yylval->string_value_->push_back(yytext[1]);
   }
 	YY_BREAK
-case 102:
+case 106:
 YY_RULE_SETUP
-#line 285 "../SqlLexer.lpp"
+#line 294 "../SqlLexer.lpp"
 {
     /* This should only be encountered right before an EOF. */
     delete yylval->string_value_;
@@ -1820,17 +1864,17 @@
 	YY_BREAK
 
 
-case 103:
+case 107:
 YY_RULE_SETUP
-#line 295 "../SqlLexer.lpp"
+#line 304 "../SqlLexer.lpp"
 {
     /* Two quotes in a row become a single quote (this is specified by the SQL standard). */
     yylval->string_value_->push_back('\'');
   }
 	YY_BREAK
-case 104:
+case 108:
 YY_RULE_SETUP
-#line 299 "../SqlLexer.lpp"
+#line 308 "../SqlLexer.lpp"
 {
     /* End string */
     BEGIN(INITIAL);
@@ -1839,17 +1883,17 @@
 	YY_BREAK
 
 
-case 105:
+case 109:
 YY_RULE_SETUP
-#line 307 "../SqlLexer.lpp"
+#line 316 "../SqlLexer.lpp"
 {
     /* Two quotes in a row become a single quote (this is specified by the SQL standard). */
     yylval->string_value_->push_back('"');
   }
 	YY_BREAK
-case 106:
+case 110:
 YY_RULE_SETUP
-#line 311 "../SqlLexer.lpp"
+#line 320 "../SqlLexer.lpp"
 {
     /* End string */
     BEGIN(INITIAL);
@@ -1857,85 +1901,85 @@
   }
 	YY_BREAK
 
-case 107:
-/* rule 107 can match eol */
+case 111:
+/* rule 111 can match eol */
 YY_RULE_SETUP
-#line 318 "../SqlLexer.lpp"
+#line 327 "../SqlLexer.lpp"
 {
   /* Scan up to a quote. */
   yylval->string_value_->append(yytext, yyleng);
 }
 	YY_BREAK
-case 108:
-/* rule 108 can match eol */
+case 112:
+/* rule 112 can match eol */
 YY_RULE_SETUP
-#line 323 "../SqlLexer.lpp"
+#line 332 "../SqlLexer.lpp"
 {
   /* Scan up to a quote or escape sequence. */
   yylval->string_value_->append(yytext, yyleng);
 }
 	YY_BREAK
-case 109:
-/* rule 109 can match eol */
+case 113:
+/* rule 113 can match eol */
 YY_RULE_SETUP
-#line 328 "../SqlLexer.lpp"
+#line 337 "../SqlLexer.lpp"
 {
   /* Scan up to a quote. */
   yylval->string_value_->append(yytext, yyleng);
 }
 	YY_BREAK
-case 110:
+case 114:
 YY_RULE_SETUP
-#line 333 "../SqlLexer.lpp"
+#line 342 "../SqlLexer.lpp"
 {
   yylval->string_value_ = new quickstep::ParseString(
       yylloc->first_line, yylloc->first_column, std::string(yytext, yyleng));
   return TOKEN_NAME;
 }
 	YY_BREAK
-case 111:
+case 115:
 YY_RULE_SETUP
-#line 339 "../SqlLexer.lpp"
+#line 348 "../SqlLexer.lpp"
 {
   yylval->numeric_literal_value_ = new quickstep::NumericParseLiteralValue(
       yylloc->first_line, yylloc->first_column, yytext);
   return TOKEN_UNSIGNED_NUMVAL;
 }
 	YY_BREAK
-case 112:
-/* rule 112 can match eol */
+case 116:
+/* rule 116 can match eol */
 YY_RULE_SETUP
-#line 345 "../SqlLexer.lpp"
+#line 354 "../SqlLexer.lpp"
 { yycolumn = 0; }
 	YY_BREAK
-case 113:
+case 117:
 YY_RULE_SETUP
-#line 347 "../SqlLexer.lpp"
+#line 356 "../SqlLexer.lpp"
 ; /* ignore white space */
 	YY_BREAK
-case 114:
+case 118:
 YY_RULE_SETUP
-#line 349 "../SqlLexer.lpp"
+#line 358 "../SqlLexer.lpp"
 /* comment */
 	YY_BREAK
 case YY_STATE_EOF(INITIAL):
-#line 351 "../SqlLexer.lpp"
+#line 360 "../SqlLexer.lpp"
 return TOKEN_EOF;
 	YY_BREAK
-case 115:
+case 119:
 YY_RULE_SETUP
-#line 353 "../SqlLexer.lpp"
+#line 362 "../SqlLexer.lpp"
 {
   quickstep_yyerror(NULL, yyscanner, NULL, "illegal character");
   return TOKEN_LEX_ERROR;
 }
 	YY_BREAK
-case 116:
+case 120:
 YY_RULE_SETUP
-#line 358 "../SqlLexer.lpp"
+#line 367 "../SqlLexer.lpp"
 YY_FATAL_ERROR( "flex scanner jammed" );
 	YY_BREAK
-#line 1939 "SqlLexer_gen.cpp"
+#line 1983 "SqlLexer_gen.cpp"
 
 	case YY_END_OF_BUFFER:
 		{
@@ -2229,7 +2273,7 @@
 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 			{
 			yy_current_state = (int) yy_def[yy_current_state];
-			if ( yy_current_state >= 404 )
+			if ( yy_current_state >= 427 )
 				yy_c = yy_meta[(unsigned int) yy_c];
 			}
 		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -2258,11 +2302,11 @@
 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
 		{
 		yy_current_state = (int) yy_def[yy_current_state];
-		if ( yy_current_state >= 404 )
+		if ( yy_current_state >= 427 )
 			yy_c = yy_meta[(unsigned int) yy_c];
 		}
 	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
-	yy_is_jam = (yy_current_state == 403);
+	yy_is_jam = (yy_current_state == 426);
 
 	(void)yyg;
 	return yy_is_jam ? 0 : yy_current_state;
@@ -3080,7 +3124,7 @@
 
 #define YYTABLES_NAME "yytables"
 
-#line 358 "../SqlLexer.lpp"
+#line 367 "../SqlLexer.lpp"
 
 
 
diff --git a/parser/preprocessed/SqlLexer_gen.hpp b/parser/preprocessed/SqlLexer_gen.hpp
index 5a0264e..cf2d3dc 100644
--- a/parser/preprocessed/SqlLexer_gen.hpp
+++ b/parser/preprocessed/SqlLexer_gen.hpp
@@ -345,7 +345,7 @@
 #undef YY_DECL
 #endif
 
-#line 358 "../SqlLexer.lpp"
+#line 367 "../SqlLexer.lpp"
 
 
 #line 352 "SqlLexer_gen.hpp"
diff --git a/parser/preprocessed/SqlParser_gen.cpp b/parser/preprocessed/SqlParser_gen.cpp
index 06b9789..87e523a 100644
--- a/parser/preprocessed/SqlParser_gen.cpp
+++ b/parser/preprocessed/SqlParser_gen.cpp
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
+/* A Bison parser, made by GNU Bison 3.0.4.  */
 
 /* Bison implementation for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -26,7 +26,7 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
@@ -44,7 +44,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.7.12-4996"
+#define YYBISON_VERSION "3.0.4"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -63,15 +63,12 @@
 #define yyparse         quickstep_yyparse
 #define yylex           quickstep_yylex
 #define yyerror         quickstep_yyerror
-#define yylval          quickstep_yylval
-#define yychar          quickstep_yychar
 #define yydebug         quickstep_yydebug
 #define yynerrs         quickstep_yynerrs
-#define yylloc          quickstep_yylloc
+
 
 /* Copy the first part of user declarations.  */
-/* Line 371 of yacc.c  */
-#line 33 "../SqlParser.ypp"
+#line 33 "../SqlParser.ypp" /* yacc.c:339  */
 
 
 /* Override the default definition, as we only need <first_line> and <first_column>. */
@@ -99,8 +96,7 @@
     }                                                           \
   } while (0)
 
-/* Line 371 of yacc.c  */
-#line 62 "../SqlParser.ypp"
+#line 62 "../SqlParser.ypp" /* yacc.c:339  */
 
 #include <cstdlib>
 #include <string>
@@ -112,6 +108,7 @@
 #include "parser/ParseExpression.hpp"
 #include "parser/ParseGroupBy.hpp"
 #include "parser/ParseHaving.hpp"
+#include "parser/ParseKeyValue.hpp"
 #include "parser/ParseLimit.hpp"
 #include "parser/ParseLiteralValue.hpp"
 #include "parser/ParseOrderBy.hpp"
@@ -143,14 +140,13 @@
 // Needed for Bison 2.6 and higher, which do not automatically provide this typedef.
 typedef void* yyscan_t;
 
-/* Line 371 of yacc.c  */
-#line 148 "SqlParser_gen.cpp"
+#line 144 "SqlParser_gen.cpp" /* yacc.c:339  */
 
-# ifndef YY_NULL
+# ifndef YY_NULLPTR
 #  if defined __cplusplus && 201103L <= __cplusplus
-#   define YY_NULL nullptr
+#   define YY_NULLPTR nullptr
 #  else
-#   define YY_NULL 0
+#   define YY_NULLPTR 0
 #  endif
 # endif
 
@@ -166,7 +162,7 @@
    by #include "SqlParser_gen.hpp".  */
 #ifndef YY_QUICKSTEP_YY_SQLPARSER_GEN_HPP_INCLUDED
 # define YY_QUICKSTEP_YY_SQLPARSER_GEN_HPP_INCLUDED
-/* Enabling traces.  */
+/* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
 #endif
@@ -174,111 +170,114 @@
 extern int quickstep_yydebug;
 #endif
 
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     TOKEN_NAME = 258,
-     TOKEN_STRING_SINGLE_QUOTED = 259,
-     TOKEN_STRING_DOUBLE_QUOTED = 260,
-     TOKEN_UNSIGNED_NUMVAL = 261,
-     TOKEN_OR = 262,
-     TOKEN_AND = 263,
-     TOKEN_NOT = 264,
-     TOKEN_EQ = 265,
-     TOKEN_NEQ = 266,
-     TOKEN_GEQ = 267,
-     TOKEN_GT = 268,
-     TOKEN_LEQ = 269,
-     TOKEN_LT = 270,
-     TOKEN_LIKE = 271,
-     TOKEN_BETWEEN = 272,
-     TOKEN_IS = 273,
-     UNARY_MINUS = 274,
-     UNARY_PLUS = 275,
-     TOKEN_ADD = 276,
-     TOKEN_ALL = 277,
-     TOKEN_ALTER = 278,
-     TOKEN_AS = 279,
-     TOKEN_ASC = 280,
-     TOKEN_BIGINT = 281,
-     TOKEN_BIT = 282,
-     TOKEN_BY = 283,
-     TOKEN_CHARACTER = 284,
-     TOKEN_CHECK = 285,
-     TOKEN_COLUMN = 286,
-     TOKEN_CONSTRAINT = 287,
-     TOKEN_COPY = 288,
-     TOKEN_CREATE = 289,
-     TOKEN_DATE = 290,
-     TOKEN_DATETIME = 291,
-     TOKEN_DECIMAL = 292,
-     TOKEN_DEFAULT = 293,
-     TOKEN_DELETE = 294,
-     TOKEN_DELIMITER = 295,
-     TOKEN_DESC = 296,
-     TOKEN_DISTINCT = 297,
-     TOKEN_DOUBLE = 298,
-     TOKEN_DROP = 299,
-     TOKEN_ESCAPE_STRINGS = 300,
-     TOKEN_FALSE = 301,
-     TOKEN_FIRST = 302,
-     TOKEN_FLOAT = 303,
-     TOKEN_FOREIGN = 304,
-     TOKEN_FROM = 305,
-     TOKEN_FULL = 306,
-     TOKEN_GROUP = 307,
-     TOKEN_HAVING = 308,
-     TOKEN_INNER = 309,
-     TOKEN_INSERT = 310,
-     TOKEN_INTEGER = 311,
-     TOKEN_INTERVAL = 312,
-     TOKEN_INTO = 313,
-     TOKEN_JOIN = 314,
-     TOKEN_KEY = 315,
-     TOKEN_LAST = 316,
-     TOKEN_LEFT = 317,
-     TOKEN_LIMIT = 318,
-     TOKEN_LONG = 319,
-     TOKEN_NULL = 320,
-     TOKEN_NULLS = 321,
-     TOKEN_OFF = 322,
-     TOKEN_ON = 323,
-     TOKEN_ORDER = 324,
-     TOKEN_OUTER = 325,
-     TOKEN_PRIMARY = 326,
-     TOKEN_QUIT = 327,
-     TOKEN_REAL = 328,
-     TOKEN_REFERENCES = 329,
-     TOKEN_RIGHT = 330,
-     TOKEN_ROW_DELIMITER = 331,
-     TOKEN_SELECT = 332,
-     TOKEN_SET = 333,
-     TOKEN_SMALLINT = 334,
-     TOKEN_TABLE = 335,
-     TOKEN_TIME = 336,
-     TOKEN_TIMESTAMP = 337,
-     TOKEN_TRUE = 338,
-     TOKEN_UNIQUE = 339,
-     TOKEN_UPDATE = 340,
-     TOKEN_VALUES = 341,
-     TOKEN_VARCHAR = 342,
-     TOKEN_WHERE = 343,
-     TOKEN_WITH = 344,
-     TOKEN_YEARMONTH = 345,
-     TOKEN_EOF = 346,
-     TOKEN_LEX_ERROR = 347
-   };
+  enum yytokentype
+  {
+    TOKEN_NAME = 258,
+    TOKEN_STRING_SINGLE_QUOTED = 259,
+    TOKEN_STRING_DOUBLE_QUOTED = 260,
+    TOKEN_UNSIGNED_NUMVAL = 261,
+    TOKEN_OR = 262,
+    TOKEN_AND = 263,
+    TOKEN_NOT = 264,
+    TOKEN_EQ = 265,
+    TOKEN_LT = 266,
+    TOKEN_LEQ = 267,
+    TOKEN_GT = 268,
+    TOKEN_GEQ = 269,
+    TOKEN_NEQ = 270,
+    TOKEN_LIKE = 271,
+    TOKEN_BETWEEN = 272,
+    TOKEN_IS = 273,
+    UNARY_PLUS = 274,
+    UNARY_MINUS = 275,
+    TOKEN_ADD = 276,
+    TOKEN_ALL = 277,
+    TOKEN_ALTER = 278,
+    TOKEN_AS = 279,
+    TOKEN_ASC = 280,
+    TOKEN_BIGINT = 281,
+    TOKEN_BIT = 282,
+    TOKEN_BLOOM_FILTER = 283,
+    TOKEN_CSB_TREE = 284,
+    TOKEN_BY = 285,
+    TOKEN_CHARACTER = 286,
+    TOKEN_CHECK = 287,
+    TOKEN_COLUMN = 288,
+    TOKEN_CONSTRAINT = 289,
+    TOKEN_COPY = 290,
+    TOKEN_CREATE = 291,
+    TOKEN_DATE = 292,
+    TOKEN_DATETIME = 293,
+    TOKEN_DECIMAL = 294,
+    TOKEN_DEFAULT = 295,
+    TOKEN_DELETE = 296,
+    TOKEN_DELIMITER = 297,
+    TOKEN_DESC = 298,
+    TOKEN_DISTINCT = 299,
+    TOKEN_DOUBLE = 300,
+    TOKEN_DROP = 301,
+    TOKEN_ESCAPE_STRINGS = 302,
+    TOKEN_FALSE = 303,
+    TOKEN_FIRST = 304,
+    TOKEN_FLOAT = 305,
+    TOKEN_FOREIGN = 306,
+    TOKEN_FROM = 307,
+    TOKEN_FULL = 308,
+    TOKEN_GROUP = 309,
+    TOKEN_HAVING = 310,
+    TOKEN_INDEX = 311,
+    TOKEN_INNER = 312,
+    TOKEN_INSERT = 313,
+    TOKEN_INTEGER = 314,
+    TOKEN_INTERVAL = 315,
+    TOKEN_INTO = 316,
+    TOKEN_JOIN = 317,
+    TOKEN_KEY = 318,
+    TOKEN_LAST = 319,
+    TOKEN_LEFT = 320,
+    TOKEN_LIMIT = 321,
+    TOKEN_LONG = 322,
+    TOKEN_NULL = 323,
+    TOKEN_NULLS = 324,
+    TOKEN_OFF = 325,
+    TOKEN_ON = 326,
+    TOKEN_ORDER = 327,
+    TOKEN_OUTER = 328,
+    TOKEN_PRIMARY = 329,
+    TOKEN_QUIT = 330,
+    TOKEN_REAL = 331,
+    TOKEN_REFERENCES = 332,
+    TOKEN_RIGHT = 333,
+    TOKEN_ROW_DELIMITER = 334,
+    TOKEN_SELECT = 335,
+    TOKEN_SET = 336,
+    TOKEN_SMALLINT = 337,
+    TOKEN_TABLE = 338,
+    TOKEN_TIME = 339,
+    TOKEN_TIMESTAMP = 340,
+    TOKEN_TRUE = 341,
+    TOKEN_UNIQUE = 342,
+    TOKEN_UPDATE = 343,
+    TOKEN_USING = 344,
+    TOKEN_VALUES = 345,
+    TOKEN_VARCHAR = 346,
+    TOKEN_WHERE = 347,
+    TOKEN_WITH = 348,
+    TOKEN_YEARMONTH = 349,
+    TOKEN_EOF = 350,
+    TOKEN_LEX_ERROR = 351
+  };
 #endif
 
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+
+union YYSTYPE
 {
-/* Line 387 of yacc.c  */
-#line 105 "../SqlParser.ypp"
+#line 106 "../SqlParser.ypp" /* yacc.c:355  */
 
   quickstep::ParseString *string_value_;
 
@@ -313,6 +312,12 @@
   quickstep::PtrList<quickstep::ParseColumnConstraint> *column_constraint_list_;
   quickstep::PtrList<quickstep::ParseAttributeDefinition> *attribute_definition_list_;
 
+  quickstep::ParseKeyValue *key_value_;
+  quickstep::PtrList<quickstep::ParseKeyValue> *key_value_list_;
+  quickstep::ParseKeyStringValue *key_string_value_;
+  quickstep::ParseKeyStringList *key_string_list_;
+  quickstep::ParseKeyLiteralValue *key_literal_value_;
+
   quickstep::ParseCopyFromParams *copy_from_params_;
 
   quickstep::ParseAssignment *assignment_;
@@ -348,55 +353,42 @@
   quickstep::PtrVector<quickstep::ParseSubqueryTableReference> *with_list_;
   quickstep::ParseSubqueryTableReference *with_list_element_;
 
+#line 357 "SqlParser_gen.cpp" /* yacc.c:355  */
+};
 
-/* Line 387 of yacc.c  */
-#line 354 "SqlParser_gen.cpp"
-} YYSTYPE;
+typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+/* Location type.  */
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
 {
   int first_line;
   int first_column;
   int last_line;
   int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+};
 # define YYLTYPE_IS_DECLARED 1
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
 
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int quickstep_yyparse (void *YYPARSE_PARAM);
-#else
-int quickstep_yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
+
 int quickstep_yyparse (yyscan_t yyscanner, quickstep::ParseStatement **parsedStatement);
-#else
-int quickstep_yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
 
 #endif /* !YY_QUICKSTEP_YY_SQLPARSER_GEN_HPP_INCLUDED  */
 
 /* Copy the second part of user declarations.  */
-/* Line 390 of yacc.c  */
-#line 175 "../SqlParser.ypp"
+#line 182 "../SqlParser.ypp" /* yacc.c:358  */
 
 /* This header needs YYSTYPE, which is defined by the %union directive above */
 #include "SqlLexer_gen.hpp"
 void NotSupported(const YYLTYPE *location, yyscan_t yyscanner, const std::string &feature);
 
-/* Line 390 of yacc.c  */
-#line 400 "SqlParser_gen.cpp"
+#line 392 "SqlParser_gen.cpp" /* yacc.c:358  */
 
 #ifdef short
 # undef short
@@ -410,11 +402,8 @@
 
 #ifdef YYTYPE_INT8
 typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
 #else
-typedef short int yytype_int8;
+typedef signed char yytype_int8;
 #endif
 
 #ifdef YYTYPE_UINT16
@@ -434,8 +423,7 @@
 #  define YYSIZE_T __SIZE_TYPE__
 # elif defined size_t
 #  define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+# elif ! defined YYSIZE_T
 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 #  define YYSIZE_T size_t
 # else
@@ -457,11 +445,30 @@
 # endif
 #endif
 
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later.  */
-# if (! defined __GNUC__ || __GNUC__ < 2 \
-      || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
-#  define __attribute__(Spec) /* empty */
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+#  define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
 # endif
 #endif
 
@@ -472,24 +479,25 @@
 # define YYUSE(E) /* empty */
 #endif
 
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+    _Pragma ("GCC diagnostic pop")
+#else
+# define YY_INITIAL_VALUE(Value) Value
+#endif
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
 
-/* Identity function, used to suppress warnings about constant conditions.  */
-#ifndef lint
-# define YYID(N) (N)
-#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int yyi)
-#else
-static int
-YYID (yyi)
-    int yyi;
-#endif
-{
-  return yyi;
-}
-#endif
 
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
@@ -508,8 +516,7 @@
 #    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
       /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
 #     ifndef EXIT_SUCCESS
@@ -521,8 +528,8 @@
 # endif
 
 # ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning.  */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+   /* Pacify GCC's 'empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
 #  ifndef YYSTACK_ALLOC_MAXIMUM
     /* The OS might guarantee only one guard page at the bottom of the stack,
        and a page size can be as small as 4096 bytes.  So we cannot safely
@@ -538,7 +545,7 @@
 #  endif
 #  if (defined __cplusplus && ! defined EXIT_SUCCESS \
        && ! ((defined YYMALLOC || defined malloc) \
-	     && (defined YYFREE || defined free)))
+             && (defined YYFREE || defined free)))
 #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
 #   ifndef EXIT_SUCCESS
 #    define EXIT_SUCCESS 0
@@ -546,15 +553,13 @@
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined malloc && ! defined EXIT_SUCCESS
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+#   if ! defined free && ! defined EXIT_SUCCESS
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
@@ -564,8 +569,8 @@
 
 #if (! defined yyoverflow \
      && (! defined __cplusplus \
-	 || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
-	     && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+         || (defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \
+             && defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
@@ -591,16 +596,16 @@
    elements in the stack, and YYPTR gives the new location of the
    stack.  Advance YYPTR to a properly aligned location for the next
    stack.  */
-# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
-    do									\
-      {									\
-	YYSIZE_T yynewbytes;						\
-	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
-	Stack = &yyptr->Stack_alloc;					\
-	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
-	yyptr += yynewbytes / sizeof (*yyptr);				\
-      }									\
-    while (YYID (0))
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
+    do                                                                  \
+      {                                                                 \
+        YYSIZE_T yynewbytes;                                            \
+        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
+        Stack = &yyptr->Stack_alloc;                                    \
+        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+        yyptr += yynewbytes / sizeof (*yyptr);                          \
+      }                                                                 \
+    while (0)
 
 #endif
 
@@ -619,41 +624,43 @@
           for (yyi = 0; yyi < (Count); yyi++)   \
             (Dst)[yyi] = (Src)[yyi];            \
         }                                       \
-      while (YYID (0))
+      while (0)
 #  endif
 # endif
 #endif /* !YYCOPY_NEEDED */
 
 /* YYFINAL -- State number of the termination state.  */
-#define YYFINAL  37
+#define YYFINAL  39
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   760
+#define YYLAST   975
 
 /* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS  102
+#define YYNTOKENS  106
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  72
+#define YYNNTS  81
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  193
-/* YYNRULES -- Number of states.  */
-#define YYNSTATES  375
+#define YYNRULES  209
+/* YYNSTATES -- Number of states.  */
+#define YYNSTATES  404
 
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+   by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  2
-#define YYMAXUTOK   347
+#define YYMAXUTOK   351
 
-#define YYTRANSLATE(YYX)						\
+#define YYTRANSLATE(YYX)                                                \
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, without out-of-bounds checking.  */
 static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
-      99,   100,    21,    19,   101,    20,    25,    22,     2,     2,
-       2,     2,     2,     2,     2,     2,     2,     2,     2,    98,
+     103,   104,    21,    19,   105,    20,    25,    22,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,   102,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -682,126 +689,35 @@
       60,    61,    62,    63,    64,    65,    66,    67,    68,    69,
       70,    71,    72,    73,    74,    75,    76,    77,    78,    79,
       80,    81,    82,    83,    84,    85,    86,    87,    88,    89,
-      90,    91,    92,    93,    94,    95,    96,    97
+      90,    91,    92,    93,    94,    95,    96,    97,    98,    99,
+     100,   101
 };
 
 #if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
-   YYRHS.  */
-static const yytype_uint16 yyprhs[] =
-{
-       0,     0,     3,     6,     9,    11,    13,    15,    17,    19,
-      21,    23,    25,    27,    29,    31,    33,    40,    47,    54,
-      61,    69,    73,    77,    79,    83,    85,    87,    89,    91,
-      93,    95,    97,    99,   101,   103,   105,   107,   109,   111,
-     114,   117,   122,   127,   129,   132,   134,   137,   140,   145,
-     151,   154,   156,   157,   159,   164,   170,   181,   186,   190,
-     192,   193,   195,   206,   214,   220,   221,   226,   229,   232,
-     237,   242,   248,   253,   257,   259,   263,   266,   267,   270,
-     272,   276,   280,   290,   291,   293,   295,   297,   299,   301,
-     305,   309,   312,   314,   318,   319,   321,   324,   326,   332,
-     337,   344,   350,   357,   363,   370,   376,   380,   383,   386,
-     388,   390,   393,   395,   400,   402,   406,   407,   411,   412,
-     415,   416,   420,   421,   424,   426,   430,   434,   435,   437,
-     439,   440,   443,   446,   447,   449,   452,   456,   458,   462,
-     464,   467,   469,   475,   482,   487,   491,   495,   499,   503,
-     507,   509,   513,   515,   518,   520,   522,   524,   526,   530,
-     534,   539,   544,   546,   550,   552,   554,   557,   560,   562,
-     565,   568,   570,   574,   576,   580,   582,   584,   586,   588,
-     590,   592,   594,   596,   598,   600,   602,   604,   608,   610,
-     612,   614,   616,   618
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
-static const yytype_int16 yyrhs[] =
-{
-     103,     0,    -1,   104,    98,    -1,   104,    96,    -1,     1,
-      -1,    96,    -1,   106,    -1,   119,    -1,   107,    -1,   123,
-      -1,   108,    -1,   118,    -1,   105,    -1,   126,    -1,   122,
-      -1,    77,    -1,    28,    85,   172,    26,    36,   109,    -1,
-      28,    85,   172,    26,    37,   115,    -1,    28,    85,   172,
-      49,    36,   172,    -1,    28,    85,   172,    49,    37,   172,
-      -1,    39,    85,   172,    99,   110,   100,   117,    -1,    49,
-      85,   172,    -1,   172,   111,   114,    -1,   109,    -1,   110,
-     101,   109,    -1,    32,    -1,    40,    -1,    41,    -1,    86,
-      -1,    87,    -1,    42,    -1,    78,    -1,    48,    -1,    53,
-      -1,    84,    -1,    61,    -1,    31,    -1,    69,    -1,    62,
-      -1,    41,    62,    -1,    95,    62,    -1,    34,    99,     6,
-     100,    -1,    92,    99,     6,   100,    -1,    70,    -1,     9,
-      70,    -1,    89,    -1,    76,    65,    -1,    43,   164,    -1,
-      35,    99,   154,   100,    -1,    79,   172,    99,   172,   100,
-      -1,   113,   112,    -1,   112,    -1,    -1,   113,    -1,    89,
-      99,   171,   100,    -1,    76,    65,    99,   171,   100,    -1,
-      54,    65,    99,   171,   100,    79,   172,    99,   171,   100,
-      -1,    35,    99,   154,   100,    -1,   116,   101,   115,    -1,
-     115,    -1,    -1,   116,    -1,    60,    63,   172,    99,   171,
-     100,    91,    99,   165,   100,    -1,    60,    63,   172,    91,
-      99,   165,   100,    -1,    38,   172,    55,     4,   120,    -1,
-      -1,    94,    99,   121,   100,    -1,    45,     4,    -1,    50,
-     173,    -1,   121,   101,    45,     4,    -1,   121,   101,    50,
-     173,    -1,    90,   172,    83,   124,   152,    -1,    44,    55,
-     172,   152,    -1,   124,   101,   125,    -1,   125,    -1,   172,
-      10,   158,    -1,   127,   130,    -1,    -1,    94,   128,    -1,
-     129,    -1,   128,   101,   129,    -1,   142,    29,   139,    -1,
-      82,   131,   132,   135,   152,   144,   145,   146,   147,    -1,
-      -1,    27,    -1,    47,    -1,    21,    -1,   133,    -1,   134,
-      -1,   133,   101,   134,    -1,   158,    29,   172,    -1,   158,
-     172,    -1,   158,    -1,    55,   143,   136,    -1,    -1,   137,
-      -1,   137,   138,    -1,   138,    -1,    59,    64,   171,    73,
-     154,    -1,    64,   171,    73,   154,    -1,    67,    75,    64,
-     171,    73,   154,    -1,    67,    64,   171,    73,   154,    -1,
-      80,    75,    64,   171,    73,   154,    -1,    80,    64,   171,
-      73,   154,    -1,    56,    75,    64,   171,    73,   154,    -1,
-      56,    64,   171,    73,   154,    -1,    99,   130,   100,    -1,
-     139,   141,    -1,   172,   141,    -1,   172,    -1,   142,    -1,
-      29,   142,    -1,   172,    -1,   172,    99,   171,   100,    -1,
-     140,    -1,   143,   101,   140,    -1,    -1,    57,    33,   163,
-      -1,    -1,    58,   154,    -1,    -1,    74,    33,   148,    -1,
-      -1,    68,     6,    -1,   149,    -1,   148,   101,   149,    -1,
-     158,   150,   151,    -1,    -1,    30,    -1,    46,    -1,    -1,
-      71,    52,    -1,    71,    66,    -1,    -1,   153,    -1,    93,
-     154,    -1,   154,     7,   155,    -1,   155,    -1,   155,     8,
-     156,    -1,   156,    -1,     9,   157,    -1,   157,    -1,   158,
-      17,   158,     8,   158,    -1,   158,     9,    17,   158,     8,
-     158,    -1,   166,    18,     9,    70,    -1,   166,    18,    70,
-      -1,   158,    16,     4,    -1,   158,   167,   158,    -1,    99,
-     154,   100,    -1,   158,   169,   159,    -1,   159,    -1,   159,
-     170,   160,    -1,   160,    -1,   168,   161,    -1,   161,    -1,
-     166,    -1,   164,    -1,   162,    -1,    99,   158,   100,    -1,
-     172,    99,   100,    -1,   172,    99,    21,   100,    -1,   172,
-      99,   163,   100,    -1,   158,    -1,   163,   101,   158,    -1,
-      70,    -1,     6,    -1,    19,     6,    -1,    20,     6,    -1,
-       4,    -1,    62,     4,    -1,   111,     4,    -1,   164,    -1,
-     165,   101,   164,    -1,   172,    -1,   172,    25,   172,    -1,
-      10,    -1,    11,    -1,    15,    -1,    14,    -1,    13,    -1,
-      12,    -1,    20,    -1,    19,    -1,    20,    -1,    21,    -1,
-      22,    -1,   172,    -1,   171,   101,   172,    -1,     3,    -1,
-       5,    -1,    88,    -1,    73,    -1,    51,    -1,    72,    -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   459,   459,   463,   467,   470,   477,   480,   483,   486,
-     489,   492,   495,   498,   501,   507,   513,   520,   526,   533,
-     542,   547,   552,   557,   561,   567,   572,   575,   578,   583,
-     586,   589,   592,   595,   598,   601,   604,   607,   610,   622,
-     625,   628,   646,   666,   669,   672,   677,   682,   688,   694,
-     703,   707,   713,   716,   721,   726,   731,   738,   745,   749,
-     755,   758,   764,   772,   777,   782,   785,   790,   794,   798,
-     802,   808,   813,   818,   822,   828,   834,   839,   842,   847,
-     851,   857,   863,   869,   872,   876,   882,   885,   890,   894,
-     900,   903,   906,   911,   916,   919,   925,   929,   935,   941,
-     947,   953,   959,   965,   971,   977,   985,   990,   994,   998,
-    1003,  1006,  1011,  1014,  1019,  1023,  1029,  1032,  1037,  1040,
-    1045,  1048,  1053,  1056,  1075,  1079,  1085,  1092,  1095,  1098,
-    1103,  1106,  1109,  1115,  1118,  1123,  1128,  1137,  1142,  1151,
-    1156,  1159,  1164,  1167,  1172,  1178,  1184,  1191,  1194,  1201,
-    1204,  1209,  1212,  1217,  1220,  1225,  1228,  1231,  1234,  1239,
-    1243,  1247,  1252,  1256,  1262,  1265,  1268,  1271,  1283,  1287,
-    1306,  1321,  1325,  1331,  1334,  1340,  1343,  1346,  1349,  1352,
-    1355,  1360,  1371,  1374,  1379,  1382,  1388,  1392,  1398,  1401,
-    1409,  1412,  1415,  1418
+       0,   491,   491,   495,   499,   502,   509,   512,   515,   518,
+     521,   524,   527,   530,   533,   536,   542,   548,   555,   561,
+     568,   577,   582,   594,   599,   604,   608,   614,   619,   622,
+     625,   630,   633,   636,   639,   642,   645,   648,   651,   654,
+     657,   669,   672,   675,   693,   713,   716,   719,   724,   729,
+     735,   741,   750,   754,   760,   763,   768,   773,   778,   785,
+     792,   796,   802,   805,   810,   813,   821,   825,   831,   834,
+     837,   842,   847,   852,   857,   862,   869,   872,   879,   887,
+     892,   897,   900,   905,   909,   913,   917,   923,   928,   933,
+     937,   943,   949,   954,   957,   962,   966,   972,   978,   984,
+     987,   991,   997,  1000,  1005,  1009,  1015,  1018,  1021,  1026,
+    1031,  1034,  1040,  1044,  1050,  1056,  1062,  1068,  1074,  1080,
+    1086,  1092,  1100,  1105,  1109,  1113,  1118,  1121,  1126,  1129,
+    1134,  1138,  1144,  1147,  1152,  1155,  1160,  1163,  1168,  1171,
+    1190,  1194,  1200,  1207,  1210,  1213,  1218,  1221,  1224,  1230,
+    1233,  1238,  1243,  1252,  1257,  1266,  1271,  1274,  1279,  1282,
+    1287,  1293,  1299,  1306,  1309,  1316,  1319,  1324,  1327,  1332,
+    1335,  1340,  1343,  1346,  1349,  1354,  1358,  1362,  1367,  1371,
+    1377,  1380,  1383,  1386,  1398,  1402,  1421,  1436,  1440,  1446,
+    1449,  1455,  1458,  1461,  1464,  1467,  1470,  1475,  1486,  1489,
+    1494,  1497,  1503,  1507,  1513,  1516,  1524,  1527,  1530,  1533
 };
 #endif
 
@@ -813,32 +729,36 @@
   "$end", "error", "$undefined", "TOKEN_NAME",
   "TOKEN_STRING_SINGLE_QUOTED", "TOKEN_STRING_DOUBLE_QUOTED",
   "TOKEN_UNSIGNED_NUMVAL", "TOKEN_OR", "TOKEN_AND", "TOKEN_NOT",
-  "TOKEN_EQ", "TOKEN_NEQ", "TOKEN_GEQ", "TOKEN_GT", "TOKEN_LEQ",
-  "TOKEN_LT", "TOKEN_LIKE", "TOKEN_BETWEEN", "TOKEN_IS", "'+'", "'-'",
-  "'*'", "'/'", "UNARY_MINUS", "UNARY_PLUS", "'.'", "TOKEN_ADD",
+  "TOKEN_EQ", "TOKEN_LT", "TOKEN_LEQ", "TOKEN_GT", "TOKEN_GEQ",
+  "TOKEN_NEQ", "TOKEN_LIKE", "TOKEN_BETWEEN", "TOKEN_IS", "'+'", "'-'",
+  "'*'", "'/'", "UNARY_PLUS", "UNARY_MINUS", "'.'", "TOKEN_ADD",
   "TOKEN_ALL", "TOKEN_ALTER", "TOKEN_AS", "TOKEN_ASC", "TOKEN_BIGINT",
-  "TOKEN_BIT", "TOKEN_BY", "TOKEN_CHARACTER", "TOKEN_CHECK",
-  "TOKEN_COLUMN", "TOKEN_CONSTRAINT", "TOKEN_COPY", "TOKEN_CREATE",
-  "TOKEN_DATE", "TOKEN_DATETIME", "TOKEN_DECIMAL", "TOKEN_DEFAULT",
-  "TOKEN_DELETE", "TOKEN_DELIMITER", "TOKEN_DESC", "TOKEN_DISTINCT",
-  "TOKEN_DOUBLE", "TOKEN_DROP", "TOKEN_ESCAPE_STRINGS", "TOKEN_FALSE",
-  "TOKEN_FIRST", "TOKEN_FLOAT", "TOKEN_FOREIGN", "TOKEN_FROM",
-  "TOKEN_FULL", "TOKEN_GROUP", "TOKEN_HAVING", "TOKEN_INNER",
-  "TOKEN_INSERT", "TOKEN_INTEGER", "TOKEN_INTERVAL", "TOKEN_INTO",
-  "TOKEN_JOIN", "TOKEN_KEY", "TOKEN_LAST", "TOKEN_LEFT", "TOKEN_LIMIT",
-  "TOKEN_LONG", "TOKEN_NULL", "TOKEN_NULLS", "TOKEN_OFF", "TOKEN_ON",
-  "TOKEN_ORDER", "TOKEN_OUTER", "TOKEN_PRIMARY", "TOKEN_QUIT",
-  "TOKEN_REAL", "TOKEN_REFERENCES", "TOKEN_RIGHT", "TOKEN_ROW_DELIMITER",
-  "TOKEN_SELECT", "TOKEN_SET", "TOKEN_SMALLINT", "TOKEN_TABLE",
-  "TOKEN_TIME", "TOKEN_TIMESTAMP", "TOKEN_TRUE", "TOKEN_UNIQUE",
-  "TOKEN_UPDATE", "TOKEN_VALUES", "TOKEN_VARCHAR", "TOKEN_WHERE",
+  "TOKEN_BIT", "TOKEN_BLOOM_FILTER", "TOKEN_CSB_TREE", "TOKEN_BY",
+  "TOKEN_CHARACTER", "TOKEN_CHECK", "TOKEN_COLUMN", "TOKEN_CONSTRAINT",
+  "TOKEN_COPY", "TOKEN_CREATE", "TOKEN_DATE", "TOKEN_DATETIME",
+  "TOKEN_DECIMAL", "TOKEN_DEFAULT", "TOKEN_DELETE", "TOKEN_DELIMITER",
+  "TOKEN_DESC", "TOKEN_DISTINCT", "TOKEN_DOUBLE", "TOKEN_DROP",
+  "TOKEN_ESCAPE_STRINGS", "TOKEN_FALSE", "TOKEN_FIRST", "TOKEN_FLOAT",
+  "TOKEN_FOREIGN", "TOKEN_FROM", "TOKEN_FULL", "TOKEN_GROUP",
+  "TOKEN_HAVING", "TOKEN_INDEX", "TOKEN_INNER", "TOKEN_INSERT",
+  "TOKEN_INTEGER", "TOKEN_INTERVAL", "TOKEN_INTO", "TOKEN_JOIN",
+  "TOKEN_KEY", "TOKEN_LAST", "TOKEN_LEFT", "TOKEN_LIMIT", "TOKEN_LONG",
+  "TOKEN_NULL", "TOKEN_NULLS", "TOKEN_OFF", "TOKEN_ON", "TOKEN_ORDER",
+  "TOKEN_OUTER", "TOKEN_PRIMARY", "TOKEN_QUIT", "TOKEN_REAL",
+  "TOKEN_REFERENCES", "TOKEN_RIGHT", "TOKEN_ROW_DELIMITER", "TOKEN_SELECT",
+  "TOKEN_SET", "TOKEN_SMALLINT", "TOKEN_TABLE", "TOKEN_TIME",
+  "TOKEN_TIMESTAMP", "TOKEN_TRUE", "TOKEN_UNIQUE", "TOKEN_UPDATE",
+  "TOKEN_USING", "TOKEN_VALUES", "TOKEN_VARCHAR", "TOKEN_WHERE",
   "TOKEN_WITH", "TOKEN_YEARMONTH", "TOKEN_EOF", "TOKEN_LEX_ERROR", "';'",
   "'('", "')'", "','", "$accept", "start", "sql_statement",
   "quit_statement", "alter_table_statement", "create_table_statement",
-  "drop_table_statement", "column_def", "column_def_commalist",
-  "data_type", "column_constraint_def", "column_constraint_def_list",
-  "opt_column_constraint_def_list", "table_constraint_def",
-  "table_constraint_def_commalist", "opt_table_constraint_def_commalist",
+  "create_index_statement", "drop_table_statement", "column_def",
+  "column_def_commalist", "data_type", "column_constraint_def",
+  "column_constraint_def_list", "opt_column_constraint_def_list",
+  "table_constraint_def", "table_constraint_def_commalist",
+  "opt_table_constraint_def_commalist", "opt_column_list",
+  "key_value_list", "key_value", "key_string_value", "key_string_list",
+  "key_literal_value", "index_type", "opt_index_properties",
   "insert_statement", "copy_from_statement", "opt_copy_from_params",
   "copy_from_params", "update_statement", "delete_statement",
   "assignment_list", "assignment_item", "select_statement",
@@ -856,13 +776,13 @@
   "expression_list", "literal_value", "literal_value_commalist",
   "attribute_ref", "comparison_operation", "unary_operation",
   "add_operation", "multiply_operation", "name_commalist", "any_name",
-  "boolean_value", YY_NULL
+  "boolean_value", YY_NULLPTR
 };
 #endif
 
 # ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
-   token YYLEX-NUM.  */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+   (internal) symbol number NUM (which must be that of a token).  */
 static const yytype_uint16 yytoknum[] =
 {
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
@@ -874,417 +794,460 @@
      310,   311,   312,   313,   314,   315,   316,   317,   318,   319,
      320,   321,   322,   323,   324,   325,   326,   327,   328,   329,
      330,   331,   332,   333,   334,   335,   336,   337,   338,   339,
-     340,   341,   342,   343,   344,   345,   346,   347,    59,    40,
-      41,    44
+     340,   341,   342,   343,   344,   345,   346,   347,   348,   349,
+     350,   351,    59,    40,    41,    44
 };
 # endif
 
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] =
-{
-       0,   102,   103,   103,   103,   103,   104,   104,   104,   104,
-     104,   104,   104,   104,   104,   105,   106,   106,   106,   106,
-     107,   108,   109,   110,   110,   111,   111,   111,   111,   111,
-     111,   111,   111,   111,   111,   111,   111,   111,   111,   111,
-     111,   111,   111,   112,   112,   112,   112,   112,   112,   112,
-     113,   113,   114,   114,   115,   115,   115,   115,   116,   116,
-     117,   117,   118,   118,   119,   120,   120,   121,   121,   121,
-     121,   122,   123,   124,   124,   125,   126,   127,   127,   128,
-     128,   129,   130,   131,   131,   131,   132,   132,   133,   133,
-     134,   134,   134,   135,   136,   136,   137,   137,   138,   138,
-     138,   138,   138,   138,   138,   138,   139,   140,   140,   140,
-     141,   141,   142,   142,   143,   143,   144,   144,   145,   145,
-     146,   146,   147,   147,   148,   148,   149,   150,   150,   150,
-     151,   151,   151,   152,   152,   153,   154,   154,   155,   155,
-     156,   156,   157,   157,   157,   157,   157,   157,   157,   158,
-     158,   159,   159,   160,   160,   161,   161,   161,   161,   162,
-     162,   162,   163,   163,   164,   164,   164,   164,   164,   164,
-     164,   165,   165,   166,   166,   167,   167,   167,   167,   167,
-     167,   168,   169,   169,   170,   170,   171,   171,   172,   172,
-     173,   173,   173,   173
-};
-
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] =
-{
-       0,     2,     2,     2,     1,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     6,     6,     6,     6,
-       7,     3,     3,     1,     3,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     1,     1,     2,
-       2,     4,     4,     1,     2,     1,     2,     2,     4,     5,
-       2,     1,     0,     1,     4,     5,    10,     4,     3,     1,
-       0,     1,    10,     7,     5,     0,     4,     2,     2,     4,
-       4,     5,     4,     3,     1,     3,     2,     0,     2,     1,
-       3,     3,     9,     0,     1,     1,     1,     1,     1,     3,
-       3,     2,     1,     3,     0,     1,     2,     1,     5,     4,
-       6,     5,     6,     5,     6,     5,     3,     2,     2,     1,
-       1,     2,     1,     4,     1,     3,     0,     3,     0,     2,
-       0,     3,     0,     2,     1,     3,     3,     0,     1,     1,
-       0,     2,     2,     0,     1,     2,     3,     1,     3,     1,
-       2,     1,     5,     6,     4,     3,     3,     3,     3,     3,
-       1,     3,     1,     2,     1,     1,     1,     1,     3,     3,
-       4,     4,     1,     3,     1,     1,     2,     2,     1,     2,
-       2,     1,     3,     1,     3,     1,     1,     1,     1,     1,
-       1,     1,     1,     1,     1,     1,     1,     3,     1,     1,
-       1,     1,     1,     1
-};
-
-/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM.
-   Performed when YYTABLE doesn't specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] =
-{
-       0,     4,     0,     0,     0,     0,     0,     0,    15,     0,
-       0,     5,     0,     0,    12,     6,     8,    10,    11,     7,
-      14,     9,    13,     0,     0,   188,   189,     0,     0,     0,
-       0,     0,     0,    78,    79,     0,   112,     1,     3,     2,
-      83,    76,     0,     0,     0,   133,    21,     0,     0,     0,
-       0,     0,    84,    85,     0,     0,     0,    65,     0,     0,
-      72,   134,     0,     0,   133,    74,     0,    80,     0,    81,
-       0,   186,   168,   165,     0,   181,    86,    36,    25,     0,
-      26,    27,    30,    32,    33,    35,     0,    37,   164,    31,
-      34,    28,    29,     0,     0,     0,     0,     0,    87,    88,
-      92,   150,   152,   154,   157,   156,   155,     0,   173,     0,
-       0,     0,     0,     0,    64,    23,     0,     0,     0,     0,
-     135,   137,   139,   141,     0,   155,     0,     0,     0,    71,
-       0,     0,   113,     0,   166,   167,     0,    39,   169,     0,
-      40,     0,   170,     0,   133,     0,   182,   183,     0,     0,
-      91,   184,   185,     0,     0,   153,     0,     0,    16,     0,
-       0,     0,     0,    17,    18,    19,     0,    60,     0,    38,
-      52,   140,     0,     0,     0,     0,     0,   175,   176,   180,
-     179,   178,   177,     0,     0,     0,     0,   171,     0,     0,
-      73,    75,   106,   187,     0,     0,   158,     0,   114,    94,
-     109,   116,    89,    90,   149,   151,   174,     0,   159,   162,
-       0,     0,     0,     0,     0,     0,     0,     0,    59,    61,
-      20,    24,     0,     0,     0,    43,     0,     0,    45,    51,
-      53,    22,   148,   136,   138,     0,   146,     0,   147,     0,
-     145,    63,     0,     0,    41,    42,     0,   107,   110,     0,
-       0,     0,     0,     0,     0,    93,    95,    97,   108,     0,
-     118,   160,   161,     0,     0,     0,     0,     0,    67,   192,
-     193,   191,   190,    68,    66,     0,     0,    44,     0,    47,
-      46,     0,    50,     0,     0,   144,   172,     0,   111,     0,
-       0,     0,     0,     0,     0,     0,     0,   115,    96,     0,
-       0,   120,   163,    57,     0,     0,    54,     0,     0,    58,
-       0,     0,     0,   142,     0,     0,     0,     0,     0,     0,
-       0,     0,     0,   117,   119,     0,   122,     0,    55,    69,
-      70,    48,     0,   143,    62,     0,     0,     0,    99,     0,
-       0,     0,     0,     0,     0,    82,     0,    49,   105,     0,
-      98,   101,     0,   103,     0,   121,   124,   127,   123,     0,
-     104,   100,   102,     0,   128,   129,   130,     0,   125,     0,
-     126,     0,   131,   132,    56
-};
-
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int16 yydefgoto[] =
-{
-      -1,    12,    13,    14,    15,    16,    17,   115,   116,    96,
-     229,   230,   231,   163,   219,   220,    18,    19,   114,   217,
-      20,    21,    64,    65,    22,    23,    33,    34,    41,    54,
-      97,    98,    99,   144,   255,   256,   257,   197,   198,   247,
-      35,   199,   260,   301,   326,   345,   355,   356,   366,   370,
-      60,    61,   120,   121,   122,   123,   124,   101,   102,   103,
-     104,   210,   105,   188,   106,   185,   107,   149,   153,    70,
-     108,   273
-};
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-#define YYPACT_NINF -166
-static const yytype_int16 yypact[] =
-{
-      39,  -166,   -41,   152,   -32,     1,   -15,    29,  -166,   152,
-     152,  -166,   105,    60,  -166,  -166,  -166,  -166,  -166,  -166,
-    -166,  -166,  -166,    52,   152,  -166,  -166,    91,   152,   152,
-     152,   152,    68,    58,  -166,   146,    81,  -166,  -166,  -166,
-      48,  -166,    13,   183,    92,   119,  -166,   -48,   152,   152,
-     106,   152,  -166,  -166,   389,   147,   162,   129,   152,   429,
-    -166,  -166,   120,   152,   -35,  -166,   192,  -166,    52,  -166,
-      95,  -166,  -166,  -166,   224,   226,  -166,  -166,  -166,   141,
-    -166,   180,  -166,  -166,  -166,  -166,   242,  -166,  -166,  -166,
-    -166,  -166,  -166,   148,   187,   491,   248,   200,   158,  -166,
-     159,   179,  -166,  -166,  -166,  -166,  -166,   531,   -13,   152,
-      14,   152,   152,   165,  -166,  -166,   107,   665,   593,   429,
-     254,   257,  -166,  -166,   325,   249,   625,   109,   152,  -166,
-     491,   166,  -166,   152,  -166,  -166,   264,  -166,  -166,   265,
-    -166,    -4,  -166,     5,   119,   491,  -166,  -166,   152,   491,
-    -166,  -166,  -166,   491,   226,  -166,   152,   327,  -166,   173,
-     208,   209,   177,  -166,  -166,  -166,   -21,    14,   152,  -166,
-      -5,  -166,    -2,   157,   429,   429,   260,  -166,  -166,  -166,
-    -166,  -166,  -166,   274,   491,   491,     9,  -166,   113,   188,
-    -166,   196,  -166,  -166,   181,   182,  -166,   114,  -166,    80,
-     114,   223,  -166,  -166,   179,  -166,  -166,   184,  -166,   196,
-     117,   429,   195,   197,   152,   279,   -31,   121,  -166,   194,
-    -166,  -166,   227,   199,   625,  -166,   236,   152,  -166,  -166,
-      -5,  -166,  -166,   257,  -166,   491,  -166,   103,   196,   233,
-    -166,  -166,   625,   207,  -166,  -166,   152,  -166,  -166,    49,
-     243,   152,    51,    73,     5,  -166,   126,  -166,  -166,   276,
-     253,  -166,  -166,   491,     7,   152,   152,   125,  -166,  -166,
-    -166,  -166,  -166,  -166,  -166,    35,    14,  -166,   429,  -166,
-    -166,   216,  -166,   112,   491,  -166,  -166,   625,  -166,   152,
-     258,   152,   -54,   152,   259,   152,   261,  -166,  -166,   491,
-     429,   244,   196,  -166,   134,   136,  -166,   317,   -31,  -166,
-      10,   152,   491,   196,   138,   -51,   152,   -42,   429,   -40,
-     152,   -37,   152,   225,   254,   295,   281,   271,  -166,  -166,
-    -166,  -166,   251,   196,  -166,   429,   -19,   429,   254,   429,
-     -10,   429,     0,   491,   346,  -166,   152,  -166,   254,   429,
-     254,   254,   429,   254,   429,   252,  -166,   108,  -166,   255,
-     254,   254,   254,   491,  -166,  -166,   284,   152,  -166,   -29,
-    -166,   144,  -166,  -166,  -166
-};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int16 yypgoto[] =
-{
-    -166,  -166,  -166,  -166,  -166,  -166,  -166,   -96,  -166,   239,
-     127,  -166,  -166,  -164,  -166,  -166,  -166,  -166,  -166,  -166,
-    -166,  -166,  -166,   232,  -166,  -166,  -166,   313,   297,  -166,
-    -166,  -166,   218,  -166,  -166,  -166,   110,   320,   118,   171,
-    -165,  -166,  -166,  -166,  -166,  -166,  -166,    11,  -166,  -166,
-     -55,  -166,   -50,   202,   198,   263,   -43,   228,   229,   272,
-    -166,    79,  -124,    96,   -25,  -166,  -166,  -166,  -166,   -62,
-      -3,    76
-};
-
-/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule which
-   number is the opposite.  If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -78
-static const yytype_int16 yytable[] =
-{
-      27,   127,   187,   218,   222,   174,    32,    36,    25,   129,
-      26,   100,   156,   158,   174,   146,   147,   174,   239,   318,
-     269,    42,   335,   372,   215,    44,    45,    46,    47,   216,
-     223,   337,   248,   339,   125,   248,   341,   373,   224,    55,
-       1,   270,   271,    62,    24,    66,    36,   133,    71,   159,
-     133,    63,   141,    28,   349,   117,    29,   272,    59,   133,
-      71,   133,    56,   352,   133,   225,   128,     2,   160,   172,
-      30,   226,   221,   354,   227,    52,   173,     3,     4,   240,
-     307,   288,   133,     5,   228,   308,   157,   191,     6,   201,
-     161,   133,    31,   125,   125,    53,   196,   150,   232,     7,
-     279,   133,   100,   162,    68,    37,   117,   303,   164,   165,
-     331,   284,   309,   289,   209,   293,     8,    25,   286,    26,
-     312,   -77,   146,   147,   290,    66,   294,   146,   147,     9,
-     193,   146,   147,    10,    40,    11,   249,   295,   364,   250,
-     200,   237,   238,   246,   251,   203,    43,   252,   296,   125,
-     125,    48,   267,   206,   365,    25,    38,    26,    39,    49,
-     253,   264,    25,   187,    26,   117,   176,   177,   178,   179,
-     180,   181,   182,   183,   184,    50,   146,   147,   146,   147,
-      51,   254,   249,   109,   110,   250,   125,    57,   148,   292,
-     251,    58,   283,   252,    36,   132,   133,    36,   111,   112,
-     151,   152,   130,   304,   305,    68,   253,   167,   168,   189,
-     133,    71,    59,   241,   242,   146,   147,   262,   263,   126,
-     302,   274,   275,   113,   281,   306,   133,   315,   310,   317,
-     134,   319,   135,   321,   327,   133,   328,   133,   334,   242,
-     136,   313,   137,    36,   374,   133,   138,   139,    71,   140,
-     324,   200,   142,   125,   336,   143,   209,   196,   340,   145,
-     342,   174,    71,    71,   166,   175,   192,   186,   338,   333,
-     194,   195,   211,   212,   213,   125,   214,   235,   236,   243,
-     259,   244,   245,   268,   261,   348,    71,   350,    71,   351,
-      71,   353,    71,   125,   265,   276,   266,   277,   278,   360,
-     357,   280,   361,   285,   362,   371,   287,   291,   332,   299,
-     125,   300,   125,    71,   125,   311,   125,    71,   325,    71,
-     357,   329,   316,   320,   125,   322,   263,   125,   343,   125,
-      25,    72,    26,    73,   176,   177,   178,   179,   180,   181,
-     182,   183,   184,   359,   146,   147,    74,    75,   207,   344,
-     346,   347,   358,   363,   367,   369,   170,   282,    77,    78,
-     190,    79,    67,   202,    71,   131,   298,    80,    81,    82,
-      69,   258,   297,   234,   368,    83,   233,   204,   323,   155,
-      84,   171,   205,   314,   330,     0,     0,     0,    85,    86,
-       0,     0,    25,    72,    26,    73,    87,    88,     0,     0,
-       0,     0,     0,     0,     0,    89,     0,     0,    74,    75,
-      76,    90,     0,    91,    92,     0,     0,     0,     0,    93,
-      77,    78,    94,    79,     0,     0,    95,   208,     0,    80,
-      81,    82,    25,    72,    26,    73,     0,    83,   118,     0,
-       0,     0,    84,     0,     0,     0,     0,     0,    74,    75,
-      85,    86,     0,     0,     0,     0,     0,     0,    87,    88,
-      77,    78,     0,    79,     0,     0,     0,    89,     0,    80,
-      81,    82,     0,    90,     0,    91,    92,    83,     0,     0,
-       0,    93,    84,     0,    94,     0,     0,     0,    95,     0,
-      85,    86,     0,     0,    25,    72,    26,    73,    87,    88,
-       0,     0,     0,     0,     0,     0,     0,    89,     0,     0,
-      74,    75,     0,    90,     0,    91,    92,     0,     0,     0,
-       0,    93,    77,    78,    94,    79,     0,     0,   119,     0,
-       0,    80,    81,    82,    25,    72,    26,    73,     0,    83,
-       0,     0,     0,     0,    84,     0,     0,     0,     0,     0,
-      74,   154,    85,    86,     0,     0,     0,     0,     0,     0,
-      87,    88,    77,    78,     0,    79,     0,     0,     0,    89,
-       0,    80,    81,    82,     0,    90,     0,    91,    92,    83,
-       0,     0,     0,    93,    84,     0,    94,     0,     0,     0,
-      95,     0,    85,    86,     0,     0,    25,    72,    26,    73,
-      87,    88,     0,     0,     0,     0,     0,     0,     0,    89,
-       0,     0,    74,    75,     0,    90,     0,    91,    92,     0,
-       0,     0,     0,    93,    77,    78,    94,    79,     0,    72,
-      95,    73,     0,    80,    81,    82,     0,     0,     0,     0,
-       0,    83,     0,     0,    74,   154,    84,     0,     0,     0,
-       0,     0,     0,     0,    85,    86,    77,    78,     0,    79,
-       0,     0,    87,    88,     0,    80,    81,    82,     0,     0,
-       0,    89,     0,    83,     0,     0,     0,    90,    84,    91,
-      92,     0,     0,     0,     0,    93,    85,    86,    94,     0,
-       0,     0,   119,     0,    87,    88,    77,    78,     0,    79,
-       0,     0,     0,    89,     0,    80,    81,    82,     0,    90,
-       0,    91,    92,    83,     0,     0,     0,    93,    84,     0,
-      94,     0,     0,     0,     0,     0,    85,   169,     0,     0,
-       0,     0,     0,     0,    87,     0,     0,     0,     0,     0,
-       0,     0,     0,    89,     0,     0,     0,     0,     0,    90,
-       0,    91,    92,     0,     0,     0,     0,    93,     0,     0,
-      94
-};
+#define YYPACT_NINF -188
 
 #define yypact_value_is_default(Yystate) \
-  (!!((Yystate) == (-166)))
+  (!!((Yystate) == (-188)))
+
+#define YYTABLE_NINF -94
 
 #define yytable_value_is_error(Yytable_value) \
-  YYID (0)
+  0
+
+  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+     STATE-NUM.  */
+static const yytype_int16 yypact[] =
+{
+      83,  -188,    19,    18,    -5,     0,    26,    67,  -188,    18,
+      18,  -188,   120,    87,  -188,  -188,  -188,  -188,  -188,  -188,
+    -188,  -188,  -188,  -188,    52,    18,  -188,  -188,    99,    18,
+      18,    18,    18,    18,    73,    57,  -188,   136,    81,  -188,
+    -188,  -188,    23,  -188,    54,   202,   116,   110,   118,  -188,
+     -30,    18,    18,   129,    18,  -188,  -188,   426,    28,   172,
+     125,    18,    18,   499,  -188,  -188,   140,    18,    35,  -188,
+     241,  -188,    52,  -188,   122,  -188,  -188,  -188,   250,   252,
+    -188,  -188,  -188,   161,  -188,   201,  -188,  -188,  -188,  -188,
+     264,  -188,  -188,  -188,  -188,  -188,  -188,   167,   208,   572,
+     272,   223,   173,  -188,   183,   207,  -188,  -188,  -188,  -188,
+    -188,   645,   -11,    18,    39,    18,    18,   181,  -188,   191,
+    -188,   132,   135,   718,   499,   279,   290,  -188,  -188,   955,
+     282,   864,   137,    18,  -188,   572,   198,  -188,    18,  -188,
+    -188,   298,  -188,  -188,   303,  -188,    -8,  -188,     5,   118,
+     572,  -188,  -188,    18,   572,  -188,  -188,  -188,   572,   252,
+    -188,    18,   352,  -188,   214,   253,   259,   226,  -188,  -188,
+    -188,   -28,    18,   236,    39,    18,  -188,    82,  -188,    -4,
+      24,   499,   499,   314,  -188,  -188,  -188,  -188,  -188,  -188,
+     329,   572,   572,     6,  -188,   141,   240,  -188,   219,  -188,
+    -188,   232,   235,  -188,   146,  -188,    90,   146,   284,  -188,
+    -188,   207,  -188,  -188,   237,  -188,   219,   143,   499,   243,
+     244,    18,   340,   -21,   150,   157,   255,  -188,   245,  -188,
+    -188,   276,   248,   864,  -188,   285,    18,  -188,  -188,    82,
+    -188,  -188,   290,  -188,   572,  -188,   134,   219,   281,  -188,
+    -188,   864,   249,  -188,  -188,    18,  -188,  -188,    21,   292,
+      18,    48,   130,     5,  -188,   147,  -188,  -188,   325,   301,
+    -188,  -188,   572,    -2,    18,    18,   186,  -188,  -188,  -188,
+    -188,  -188,  -188,  -188,    89,  -188,  -188,  -188,   260,    39,
+    -188,   499,  -188,  -188,   262,  -188,   174,   572,  -188,  -188,
+     864,  -188,    18,   295,    18,   -58,    18,   302,    18,   307,
+    -188,  -188,   572,   499,   291,   219,  -188,   188,   192,  -188,
+     371,   -21,    18,  -188,  -188,     2,    18,   572,   219,   203,
+     -31,    18,   -16,   499,   -15,    18,    -7,    18,   271,   279,
+     342,   308,   296,  -188,  -188,  -188,   209,  -188,  -188,  -188,
+    -188,   791,  -188,   277,   219,  -188,   499,    -1,   499,   279,
+     499,    11,   499,    17,   572,   374,  -188,    18,  -188,    18,
+      18,  -188,  -188,  -188,   279,   499,   279,   279,   499,   279,
+     499,   280,  -188,    33,  -188,   283,  -188,   211,   279,   279,
+     279,   572,  -188,  -188,   313,    18,  -188,  -188,     8,  -188,
+     221,  -188,  -188,  -188
+};
+
+  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+     Performed when YYTABLE does not specify something else to do.  Zero
+     means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       0,     4,     0,     0,     0,     0,     0,     0,    16,     0,
+       0,     5,     0,     0,    13,     6,     8,     9,    11,    12,
+       7,    15,    10,    14,     0,     0,   204,   205,     0,     0,
+       0,     0,     0,     0,     0,    94,    95,     0,   128,     1,
+       3,     2,    99,    92,     0,     0,     0,     0,   149,    23,
+       0,     0,     0,     0,     0,   100,   101,     0,     0,     0,
+      81,     0,     0,     0,    88,   150,     0,     0,   149,    90,
+       0,    96,     0,    97,     0,   202,   184,   181,     0,   197,
+     102,    38,    27,     0,    28,    29,    32,    34,    35,    37,
+       0,    39,   180,    33,    36,    30,    31,     0,     0,     0,
+       0,     0,   103,   104,   108,   166,   168,   170,   173,   172,
+     171,     0,   189,     0,     0,     0,     0,     0,    80,    64,
+      25,     0,     0,     0,     0,   151,   153,   155,   157,     0,
+     171,     0,     0,     0,    87,     0,     0,   129,     0,   182,
+     183,     0,    41,   185,     0,    42,     0,   186,     0,   149,
+       0,   198,   199,     0,     0,   107,   200,   201,     0,     0,
+     169,     0,     0,    17,     0,     0,     0,     0,    18,    19,
+      20,     0,     0,     0,    62,     0,    40,    54,   156,     0,
+       0,     0,     0,     0,   191,   193,   194,   195,   196,   192,
+       0,     0,     0,     0,   187,     0,     0,    89,    91,   122,
+     203,     0,     0,   174,     0,   130,   110,   125,   132,   105,
+     106,   165,   167,   190,     0,   175,   178,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,    61,    63,    21,
+      26,     0,     0,     0,    45,     0,     0,    47,    53,    55,
+      24,   164,   152,   154,     0,   162,     0,   163,     0,   161,
+      79,     0,     0,    43,    44,     0,   123,   126,     0,     0,
+       0,     0,     0,     0,   109,   111,   113,   124,     0,   134,
+     176,   177,     0,     0,     0,     0,     0,    83,   208,   209,
+     207,   206,    84,    82,     0,    65,    74,    75,    76,     0,
+      46,     0,    49,    48,     0,    52,     0,     0,   160,   188,
+       0,   127,     0,     0,     0,     0,     0,     0,     0,     0,
+     131,   112,     0,     0,   136,   179,    59,     0,     0,    56,
+       0,     0,     0,    22,    60,     0,     0,     0,   158,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   133,   135,
+       0,   138,     0,    57,    85,    86,     0,    66,    68,    69,
+      70,     0,    50,     0,   159,    78,     0,     0,     0,   115,
+       0,     0,     0,     0,     0,     0,    98,     0,    77,     0,
+       0,    73,    71,    51,   121,     0,   114,   117,     0,   119,
+       0,   137,   140,   143,   139,     0,    67,     0,   120,   116,
+     118,     0,   144,   145,   146,     0,    72,   141,     0,   142,
+       0,   147,   148,    58
+};
+
+  /* YYPGOTO[NTERM-NUM].  */
+static const yytype_int16 yypgoto[] =
+{
+    -188,  -188,  -188,  -188,  -188,  -188,  -188,  -188,   -97,  -188,
+     267,   151,  -188,  -188,  -172,  -188,  -188,  -188,  -188,    13,
+    -188,  -188,  -188,  -188,  -188,  -188,  -188,  -188,  -188,  -188,
+    -188,  -188,   258,  -188,  -188,  -188,   341,   326,  -188,  -188,
+    -188,   247,  -188,  -188,  -188,   138,   346,   142,   193,  -187,
+    -188,  -188,  -188,  -188,  -188,  -188,    10,  -188,  -188,   -55,
+    -188,   -93,   225,   222,   286,   -53,   254,   256,   299,  -188,
+     100,  -130,   111,   -38,  -188,  -188,  -188,  -188,   -25,    -3,
+      92
+};
+
+  /* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,    12,    13,    14,    15,    16,    17,    18,   120,   121,
+     100,   238,   239,   240,   168,   228,   229,   173,   346,   347,
+     348,   349,   350,   288,   323,    19,    20,   118,   224,    21,
+      22,    68,    69,    23,    24,    35,    36,    43,    57,   101,
+     102,   103,   149,   264,   265,   266,   204,   205,   256,    37,
+     206,   269,   314,   341,   366,   381,   382,   394,   399,    64,
+      65,   125,   126,   127,   128,   129,   105,   106,   107,   108,
+     217,   109,   195,   110,   192,   111,   154,   158,    74,   112,
+     282
+};
+
+  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
+     positive, shift that token.  If negative, reduce the rule whose
+     number is the opposite.  If YYTABLE_NINF, syntax error.  */
+static const yytype_int16 yytable[] =
+{
+      28,   194,   227,   181,   104,   181,    34,    38,    26,   181,
+      27,   151,   152,   134,   161,   248,   163,   257,   333,   222,
+     257,    26,    44,    27,   223,   130,    46,    47,    48,    49,
+      50,   179,   278,   183,   184,   185,   186,   187,   188,   189,
+     190,   191,   132,   151,   152,   356,   146,   138,    70,    38,
+      55,    75,   151,   152,   279,   280,    29,    31,   119,   122,
+     358,   360,   401,   392,    75,    66,   113,   114,   301,   362,
+     281,   180,    56,    67,   138,   375,   164,   402,   230,   249,
+      58,   393,   198,    30,     1,   130,   130,   378,   302,   138,
+     138,   231,   162,   380,   208,   165,   203,   104,   138,   303,
+     241,   155,   316,   292,   138,    59,   352,    25,    72,   216,
+     122,     2,   169,   170,    32,   306,   138,   324,   166,   232,
+      39,   299,   138,     3,     4,   273,   307,   233,   203,     5,
+      70,   167,    63,    33,     6,   200,   320,    42,   246,   247,
+     133,   321,   297,   130,   130,   207,     7,   225,   258,    26,
+     210,    27,   259,   151,   152,   234,    45,   260,   213,    51,
+     261,   235,    52,     8,   236,    53,    81,    82,   -93,    75,
+     194,    83,   122,   262,   237,   255,     9,    84,    85,    86,
+     130,    10,   327,    11,    54,    87,    26,    40,    27,    41,
+      88,   296,    61,   151,   152,   263,   276,   308,   325,    89,
+     176,    38,   151,   152,    38,   258,    60,    91,   309,   259,
+     115,   116,   153,    62,   260,    63,    93,   261,    75,   315,
+     339,   371,    94,   117,    95,    96,   137,   138,   156,   157,
+     262,    97,    72,   294,    98,   305,   174,   175,   151,   152,
+     359,   196,   138,   131,   328,   250,   251,   271,   272,   317,
+     318,   135,    38,   130,   283,   284,   139,    75,   140,   216,
+     207,   285,   138,   374,   141,   376,   142,   377,   143,   379,
+     144,    75,    75,   145,   354,   130,   147,   330,   150,   332,
+     148,   334,   388,   336,   171,   389,   181,   390,   286,   287,
+     319,   138,   342,   138,   172,   130,   343,   138,   182,    75,
+     193,    75,   199,    75,   201,    75,   357,   355,   251,   202,
+     361,   383,   363,   368,   369,   396,   138,   218,   130,   351,
+     130,   219,   130,   353,   130,   403,   138,   220,    75,   221,
+     226,   244,    75,   245,    75,   252,   253,   130,   383,   254,
+     130,   270,   130,   268,   277,   387,   274,   275,   372,   290,
+     289,   291,   300,   293,   298,    26,    76,    27,    77,   304,
+     312,   313,   331,   322,   385,   326,   351,    75,   340,   335,
+     400,    78,    79,   214,   337,   344,   272,   364,   367,   365,
+     384,   373,   386,    81,    82,   391,   395,   398,    83,   177,
+     295,   197,    75,    71,    84,    85,    86,   209,   136,    73,
+     267,   397,    87,   311,   243,   310,   242,    88,   211,   178,
+     160,   329,   338,   345,   212,     0,    89,    90,     0,     0,
+       0,     0,     0,     0,    91,    92,     0,     0,     0,    26,
+      76,    27,    77,    93,     0,     0,     0,     0,     0,    94,
+       0,    95,    96,     0,     0,    78,    79,    80,    97,     0,
+       0,    98,     0,     0,     0,    99,   215,    81,    82,     0,
+       0,     0,    83,     0,     0,     0,     0,     0,    84,    85,
+      86,     0,     0,     0,     0,     0,    87,     0,     0,     0,
+       0,    88,     0,     0,     0,     0,     0,     0,     0,     0,
+      89,    90,     0,     0,     0,     0,     0,     0,    91,    92,
+       0,     0,    26,    76,    27,    77,     0,    93,   123,     0,
+       0,     0,     0,    94,     0,    95,    96,     0,    78,    79,
+       0,     0,    97,     0,     0,    98,     0,     0,     0,    99,
+      81,    82,     0,     0,     0,    83,     0,     0,     0,     0,
+       0,    84,    85,    86,     0,     0,     0,     0,     0,    87,
+       0,     0,     0,     0,    88,     0,     0,     0,     0,     0,
+       0,     0,     0,    89,    90,     0,     0,     0,     0,     0,
+       0,    91,    92,     0,     0,    26,    76,    27,    77,     0,
+      93,     0,     0,     0,     0,     0,    94,     0,    95,    96,
+       0,    78,    79,     0,     0,    97,     0,     0,    98,     0,
+       0,     0,   124,    81,    82,     0,     0,     0,    83,     0,
+       0,     0,     0,     0,    84,    85,    86,     0,     0,     0,
+       0,     0,    87,     0,     0,     0,     0,    88,     0,     0,
+       0,     0,     0,     0,     0,     0,    89,    90,     0,     0,
+       0,     0,     0,     0,    91,    92,     0,     0,    26,    76,
+      27,    77,     0,    93,     0,     0,     0,     0,     0,    94,
+       0,    95,    96,     0,    78,   159,     0,     0,    97,     0,
+       0,    98,     0,     0,     0,    99,    81,    82,     0,     0,
+       0,    83,     0,     0,     0,     0,     0,    84,    85,    86,
+       0,     0,     0,     0,     0,    87,     0,     0,     0,     0,
+      88,     0,     0,     0,     0,     0,     0,     0,     0,    89,
+      90,     0,     0,     0,     0,     0,     0,    91,    92,     0,
+       0,    26,    76,    27,    77,     0,    93,     0,     0,     0,
+       0,     0,    94,     0,    95,    96,     0,    78,    79,     0,
+       0,    97,     0,     0,    98,     0,     0,     0,    99,    81,
+      82,     0,     0,     0,    83,     0,     0,     0,     0,     0,
+      84,    85,    86,     0,     0,     0,     0,     0,    87,     0,
+       0,     0,     0,    88,     0,     0,     0,     0,     0,     0,
+       0,     0,    89,    90,     0,     0,     0,     0,     0,     0,
+      91,    92,     0,     0,    26,    76,    27,    77,     0,    93,
+       0,     0,     0,     0,     0,    94,     0,    95,    96,     0,
+      78,   159,     0,     0,    97,     0,     0,    98,     0,     0,
+       0,   124,    81,    82,     0,     0,     0,    83,     0,     0,
+       0,     0,     0,    84,    85,    86,     0,     0,     0,     0,
+       0,    87,     0,     0,     0,     0,    88,     0,     0,     0,
+       0,     0,     0,     0,     0,    89,    90,     0,     0,     0,
+       0,     0,     0,    91,    92,     0,     0,     0,    76,     0,
+      77,     0,    93,     0,     0,     0,     0,     0,    94,     0,
+      95,    96,     0,    78,   159,     0,     0,    97,     0,     0,
+      98,     0,     0,     0,   370,    81,    82,     0,     0,     0,
+      83,     0,     0,     0,     0,     0,    84,    85,    86,     0,
+       0,     0,     0,     0,    87,     0,     0,     0,     0,    88,
+       0,     0,     0,     0,     0,     0,     0,     0,    89,    90,
+       0,     0,     0,     0,     0,     0,    91,    92,     0,     0,
+       0,     0,     0,     0,     0,    93,     0,     0,     0,     0,
+       0,    94,     0,    95,    96,     0,     0,     0,     0,     0,
+      97,     0,     0,    98,   183,   184,   185,   186,   187,   188,
+     189,   190,   191,     0,   151,   152
+};
 
 static const yytype_int16 yycheck[] =
 {
-       3,    63,   126,   167,     9,     7,     9,    10,     3,    64,
-       5,    54,    25,   109,     7,    19,    20,     7,     9,    73,
-      51,    24,    73,    52,    45,    28,    29,    30,    31,    50,
-      35,    73,   197,    73,    59,   200,    73,    66,    43,    26,
-       1,    72,    73,    91,    85,    48,    49,   101,    51,    35,
-     101,    99,    95,    85,    73,    58,    55,    88,    93,   101,
-      63,   101,    49,    73,   101,    70,   101,    28,    54,   119,
-      85,    76,   168,    73,    79,    27,   119,    38,    39,    70,
-      45,   246,   101,    44,    89,    50,    99,   130,    49,   144,
-      76,   101,    63,   118,   119,    47,   100,   100,   100,    60,
-     224,   101,   145,    89,    99,     0,   109,   100,   111,   112,
-     100,     8,   276,    64,   157,    64,    77,     3,   242,     5,
-       8,    82,    19,    20,    75,   128,    75,    19,    20,    90,
-     133,    19,    20,    94,    82,    96,    56,    64,    30,    59,
-     143,   184,   185,    29,    64,   148,    55,    67,    75,   174,
-     175,    83,   214,   156,    46,     3,    96,     5,    98,   101,
-      80,   211,     3,   287,     5,   168,     9,    10,    11,    12,
-      13,    14,    15,    16,    17,    29,    19,    20,    19,    20,
-      99,   101,    56,    36,    37,    59,   211,     4,    29,   251,
-      64,    99,   235,    67,   197,   100,   101,   200,    36,    37,
-      21,    22,    10,   265,   266,    99,    80,   100,   101,   100,
-     101,   214,    93,   100,   101,    19,    20,   100,   101,    99,
-     263,   100,   101,    94,   227,   100,   101,   289,   278,   291,
-       6,   293,     6,   295,   100,   101,   100,   101,   100,   101,
-      99,   284,    62,   246,   100,   101,     4,    99,   251,    62,
-     300,   254,     4,   278,   316,    55,   299,   100,   320,   101,
-     322,     7,   265,   266,    99,     8,   100,    18,   318,   312,
-       6,     6,    99,    65,    65,   300,    99,    17,     4,    91,
-      57,   100,   100,     4,   100,   335,   289,   337,   291,   339,
-     293,   341,   295,   318,    99,   101,    99,    70,    99,   349,
-     343,    65,   352,    70,   354,   367,    99,    64,   311,    33,
-     335,    58,   337,   316,   339,    99,   341,   320,    74,   322,
-     363,     4,    64,    64,   349,    64,   101,   352,    33,   354,
-       3,     4,     5,     6,     9,    10,    11,    12,    13,    14,
-      15,    16,    17,   346,    19,    20,    19,    20,    21,    68,
-      79,   100,     6,   101,    99,    71,   117,   230,    31,    32,
-     128,    34,    49,   145,   367,    68,   256,    40,    41,    42,
-      50,   200,   254,   175,   363,    48,   174,   149,   299,   107,
-      53,   118,   153,   287,   308,    -1,    -1,    -1,    61,    62,
-      -1,    -1,     3,     4,     5,     6,    69,    70,    -1,    -1,
-      -1,    -1,    -1,    -1,    -1,    78,    -1,    -1,    19,    20,
-      21,    84,    -1,    86,    87,    -1,    -1,    -1,    -1,    92,
-      31,    32,    95,    34,    -1,    -1,    99,   100,    -1,    40,
-      41,    42,     3,     4,     5,     6,    -1,    48,     9,    -1,
-      -1,    -1,    53,    -1,    -1,    -1,    -1,    -1,    19,    20,
-      61,    62,    -1,    -1,    -1,    -1,    -1,    -1,    69,    70,
-      31,    32,    -1,    34,    -1,    -1,    -1,    78,    -1,    40,
-      41,    42,    -1,    84,    -1,    86,    87,    48,    -1,    -1,
-      -1,    92,    53,    -1,    95,    -1,    -1,    -1,    99,    -1,
-      61,    62,    -1,    -1,     3,     4,     5,     6,    69,    70,
-      -1,    -1,    -1,    -1,    -1,    -1,    -1,    78,    -1,    -1,
-      19,    20,    -1,    84,    -1,    86,    87,    -1,    -1,    -1,
-      -1,    92,    31,    32,    95,    34,    -1,    -1,    99,    -1,
-      -1,    40,    41,    42,     3,     4,     5,     6,    -1,    48,
-      -1,    -1,    -1,    -1,    53,    -1,    -1,    -1,    -1,    -1,
-      19,    20,    61,    62,    -1,    -1,    -1,    -1,    -1,    -1,
-      69,    70,    31,    32,    -1,    34,    -1,    -1,    -1,    78,
-      -1,    40,    41,    42,    -1,    84,    -1,    86,    87,    48,
-      -1,    -1,    -1,    92,    53,    -1,    95,    -1,    -1,    -1,
-      99,    -1,    61,    62,    -1,    -1,     3,     4,     5,     6,
-      69,    70,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    78,
-      -1,    -1,    19,    20,    -1,    84,    -1,    86,    87,    -1,
-      -1,    -1,    -1,    92,    31,    32,    95,    34,    -1,     4,
-      99,     6,    -1,    40,    41,    42,    -1,    -1,    -1,    -1,
-      -1,    48,    -1,    -1,    19,    20,    53,    -1,    -1,    -1,
-      -1,    -1,    -1,    -1,    61,    62,    31,    32,    -1,    34,
-      -1,    -1,    69,    70,    -1,    40,    41,    42,    -1,    -1,
-      -1,    78,    -1,    48,    -1,    -1,    -1,    84,    53,    86,
-      87,    -1,    -1,    -1,    -1,    92,    61,    62,    95,    -1,
-      -1,    -1,    99,    -1,    69,    70,    31,    32,    -1,    34,
-      -1,    -1,    -1,    78,    -1,    40,    41,    42,    -1,    84,
-      -1,    86,    87,    48,    -1,    -1,    -1,    92,    53,    -1,
-      95,    -1,    -1,    -1,    -1,    -1,    61,    62,    -1,    -1,
-      -1,    -1,    -1,    -1,    69,    -1,    -1,    -1,    -1,    -1,
-      -1,    -1,    -1,    78,    -1,    -1,    -1,    -1,    -1,    84,
-      -1,    86,    87,    -1,    -1,    -1,    -1,    92,    -1,    -1,
-      95
+       3,   131,   174,     7,    57,     7,     9,    10,     3,     7,
+       5,    19,    20,    68,    25,     9,   113,   204,    76,    47,
+     207,     3,    25,     5,    52,    63,    29,    30,    31,    32,
+      33,   124,    53,     9,    10,    11,    12,    13,    14,    15,
+      16,    17,    67,    19,    20,    76,    99,   105,    51,    52,
+      27,    54,    19,    20,    75,    76,    61,    57,    61,    62,
+      76,    76,    54,    30,    67,    95,    38,    39,   255,    76,
+      91,   124,    49,   103,   105,    76,    37,    69,   175,    73,
+      26,    48,   135,    88,     1,   123,   124,    76,    67,   105,
+     105,     9,   103,    76,   149,    56,   104,   150,   105,    78,
+     104,   104,   104,   233,   105,    51,   104,    88,   103,   162,
+     113,    28,   115,   116,    88,    67,   105,   289,    79,    37,
+       0,   251,   105,    40,    41,   218,    78,    45,   104,    46,
+     133,    92,    97,    66,    51,   138,    47,    85,   191,   192,
+     105,    52,     8,   181,   182,   148,    63,   172,    58,     3,
+     153,     5,    62,    19,    20,    73,    57,    67,   161,    86,
+      70,    79,   105,    80,    82,    29,    31,    32,    85,   172,
+     300,    36,   175,    83,    92,    29,    93,    42,    43,    44,
+     218,    98,     8,   100,   103,    50,     3,   100,     5,   102,
+      55,   244,    76,    19,    20,   105,   221,    67,   291,    64,
+      65,   204,    19,    20,   207,    58,     4,    72,    78,    62,
+      38,    39,    29,   103,    67,    97,    81,    70,   221,   272,
+     313,   351,    87,    98,    89,    90,   104,   105,    21,    22,
+      83,    96,   103,   236,    99,   260,   104,   105,    19,    20,
+     333,   104,   105,   103,   297,   104,   105,   104,   105,   274,
+     275,    10,   255,   291,   104,   105,     6,   260,     6,   312,
+     263,   104,   105,   356,   103,   358,    65,   360,     4,   362,
+     103,   274,   275,    65,   327,   313,     4,   302,   105,   304,
+      57,   306,   375,   308,   103,   378,     7,   380,    33,    34,
+     104,   105,   104,   105,   103,   333,   104,   105,     8,   302,
+      18,   304,   104,   306,     6,   308,   331,   104,   105,     6,
+     335,   364,   337,   104,   105,   104,   105,   103,   356,   322,
+     358,    68,   360,   326,   362,   104,   105,    68,   331,   103,
+      94,    17,   335,     4,   337,    95,   104,   375,   391,   104,
+     378,   104,   380,    59,     4,   370,   103,   103,   351,    73,
+     105,   103,   103,    68,    73,     3,     4,     5,     6,    67,
+      35,    60,    67,   103,   367,   103,   369,   370,    77,    67,
+     395,    19,    20,    21,    67,     4,   105,    35,    82,    71,
+       6,   104,   369,    31,    32,   105,   103,    74,    36,   122,
+     239,   133,   395,    52,    42,    43,    44,   150,    72,    53,
+     207,   391,    50,   265,   182,   263,   181,    55,   154,   123,
+     111,   300,   312,   321,   158,    -1,    64,    65,    -1,    -1,
+      -1,    -1,    -1,    -1,    72,    73,    -1,    -1,    -1,     3,
+       4,     5,     6,    81,    -1,    -1,    -1,    -1,    -1,    87,
+      -1,    89,    90,    -1,    -1,    19,    20,    21,    96,    -1,
+      -1,    99,    -1,    -1,    -1,   103,   104,    31,    32,    -1,
+      -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,    42,    43,
+      44,    -1,    -1,    -1,    -1,    -1,    50,    -1,    -1,    -1,
+      -1,    55,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      64,    65,    -1,    -1,    -1,    -1,    -1,    -1,    72,    73,
+      -1,    -1,     3,     4,     5,     6,    -1,    81,     9,    -1,
+      -1,    -1,    -1,    87,    -1,    89,    90,    -1,    19,    20,
+      -1,    -1,    96,    -1,    -1,    99,    -1,    -1,    -1,   103,
+      31,    32,    -1,    -1,    -1,    36,    -1,    -1,    -1,    -1,
+      -1,    42,    43,    44,    -1,    -1,    -1,    -1,    -1,    50,
+      -1,    -1,    -1,    -1,    55,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    64,    65,    -1,    -1,    -1,    -1,    -1,
+      -1,    72,    73,    -1,    -1,     3,     4,     5,     6,    -1,
+      81,    -1,    -1,    -1,    -1,    -1,    87,    -1,    89,    90,
+      -1,    19,    20,    -1,    -1,    96,    -1,    -1,    99,    -1,
+      -1,    -1,   103,    31,    32,    -1,    -1,    -1,    36,    -1,
+      -1,    -1,    -1,    -1,    42,    43,    44,    -1,    -1,    -1,
+      -1,    -1,    50,    -1,    -1,    -1,    -1,    55,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    64,    65,    -1,    -1,
+      -1,    -1,    -1,    -1,    72,    73,    -1,    -1,     3,     4,
+       5,     6,    -1,    81,    -1,    -1,    -1,    -1,    -1,    87,
+      -1,    89,    90,    -1,    19,    20,    -1,    -1,    96,    -1,
+      -1,    99,    -1,    -1,    -1,   103,    31,    32,    -1,    -1,
+      -1,    36,    -1,    -1,    -1,    -1,    -1,    42,    43,    44,
+      -1,    -1,    -1,    -1,    -1,    50,    -1,    -1,    -1,    -1,
+      55,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    64,
+      65,    -1,    -1,    -1,    -1,    -1,    -1,    72,    73,    -1,
+      -1,     3,     4,     5,     6,    -1,    81,    -1,    -1,    -1,
+      -1,    -1,    87,    -1,    89,    90,    -1,    19,    20,    -1,
+      -1,    96,    -1,    -1,    99,    -1,    -1,    -1,   103,    31,
+      32,    -1,    -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,
+      42,    43,    44,    -1,    -1,    -1,    -1,    -1,    50,    -1,
+      -1,    -1,    -1,    55,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    64,    65,    -1,    -1,    -1,    -1,    -1,    -1,
+      72,    73,    -1,    -1,     3,     4,     5,     6,    -1,    81,
+      -1,    -1,    -1,    -1,    -1,    87,    -1,    89,    90,    -1,
+      19,    20,    -1,    -1,    96,    -1,    -1,    99,    -1,    -1,
+      -1,   103,    31,    32,    -1,    -1,    -1,    36,    -1,    -1,
+      -1,    -1,    -1,    42,    43,    44,    -1,    -1,    -1,    -1,
+      -1,    50,    -1,    -1,    -1,    -1,    55,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    64,    65,    -1,    -1,    -1,
+      -1,    -1,    -1,    72,    73,    -1,    -1,    -1,     4,    -1,
+       6,    -1,    81,    -1,    -1,    -1,    -1,    -1,    87,    -1,
+      89,    90,    -1,    19,    20,    -1,    -1,    96,    -1,    -1,
+      99,    -1,    -1,    -1,   103,    31,    32,    -1,    -1,    -1,
+      36,    -1,    -1,    -1,    -1,    -1,    42,    43,    44,    -1,
+      -1,    -1,    -1,    -1,    50,    -1,    -1,    -1,    -1,    55,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    64,    65,
+      -1,    -1,    -1,    -1,    -1,    -1,    72,    73,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    81,    -1,    -1,    -1,    -1,
+      -1,    87,    -1,    89,    90,    -1,    -1,    -1,    -1,    -1,
+      96,    -1,    -1,    99,     9,    10,    11,    12,    13,    14,
+      15,    16,    17,    -1,    19,    20
 };
 
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
+  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+     symbol of state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
-       0,     1,    28,    38,    39,    44,    49,    60,    77,    90,
-      94,    96,   103,   104,   105,   106,   107,   108,   118,   119,
-     122,   123,   126,   127,    85,     3,     5,   172,    85,    55,
-      85,    63,   172,   128,   129,   142,   172,     0,    96,    98,
-      82,   130,   172,    55,   172,   172,   172,   172,    83,   101,
-      29,    99,    27,    47,   131,    26,    49,     4,    99,    93,
-     152,   153,    91,    99,   124,   125,   172,   129,    99,   139,
-     171,   172,     4,     6,    19,    20,    21,    31,    32,    34,
-      40,    41,    42,    48,    53,    61,    62,    69,    70,    78,
-      84,    86,    87,    92,    95,    99,   111,   132,   133,   134,
-     158,   159,   160,   161,   162,   164,   166,   168,   172,    36,
-      37,    36,    37,    94,   120,   109,   110,   172,     9,    99,
-     154,   155,   156,   157,   158,   166,    99,   171,   101,   152,
-      10,   130,   100,   101,     6,     6,    99,    62,     4,    99,
-      62,   158,     4,    55,   135,   101,    19,    20,    29,   169,
-     172,    21,    22,   170,    20,   161,    25,    99,   109,    35,
-      54,    76,    89,   115,   172,   172,    99,   100,   101,    62,
-     111,   157,   154,   158,     7,     8,     9,    10,    11,    12,
-      13,    14,    15,    16,    17,   167,    18,   164,   165,   100,
-     125,   158,   100,   172,     6,     6,   100,   139,   140,   143,
-     172,   152,   134,   172,   159,   160,   172,    21,   100,   158,
-     163,    99,    65,    65,    99,    45,    50,   121,   115,   116,
-     117,   109,     9,    35,    43,    70,    76,    79,    89,   112,
-     113,   114,   100,   155,   156,    17,     4,   158,   158,     9,
-      70,   100,   101,    91,   100,   100,    29,   141,   142,    56,
-      59,    64,    67,    80,   101,   136,   137,   138,   141,    57,
-     144,   100,   100,   101,   154,    99,    99,   171,     4,    51,
-      72,    73,    88,   173,   100,   101,   101,    70,    99,   164,
-      65,   172,   112,   158,     8,    70,   164,    99,   142,    64,
-      75,    64,   171,    64,    75,    64,    75,   140,   138,    33,
-      58,   145,   158,   100,   171,   171,   100,    45,    50,   115,
-     154,    99,     8,   158,   165,   171,    64,   171,    73,   171,
-      64,   171,    64,   163,   154,    74,   146,   100,   100,     4,
-     173,   100,   172,   158,   100,    73,   171,    73,   154,    73,
-     171,    73,   171,    33,    68,   147,    79,   100,   154,    73,
-     154,   154,    73,   154,    73,   148,   149,   158,     6,   172,
-     154,   154,   154,   101,    30,    46,   150,    99,   149,    71,
-     151,   171,    52,    66,   100
+       0,     1,    28,    40,    41,    46,    51,    63,    80,    93,
+      98,   100,   107,   108,   109,   110,   111,   112,   113,   131,
+     132,   135,   136,   139,   140,    88,     3,     5,   185,    61,
+      88,    57,    88,    66,   185,   141,   142,   155,   185,     0,
+     100,   102,    85,   143,   185,    57,   185,   185,   185,   185,
+     185,    86,   105,    29,   103,    27,    49,   144,    26,    51,
+       4,    76,   103,    97,   165,   166,    95,   103,   137,   138,
+     185,   142,   103,   152,   184,   185,     4,     6,    19,    20,
+      21,    31,    32,    36,    42,    43,    44,    50,    55,    64,
+      65,    72,    73,    81,    87,    89,    90,    96,    99,   103,
+     116,   145,   146,   147,   171,   172,   173,   174,   175,   177,
+     179,   181,   185,    38,    39,    38,    39,    98,   133,   185,
+     114,   115,   185,     9,   103,   167,   168,   169,   170,   171,
+     179,   103,   184,   105,   165,    10,   143,   104,   105,     6,
+       6,   103,    65,     4,   103,    65,   171,     4,    57,   148,
+     105,    19,    20,    29,   182,   185,    21,    22,   183,    20,
+     174,    25,   103,   114,    37,    56,    79,    92,   120,   185,
+     185,   103,   103,   123,   104,   105,    65,   116,   170,   167,
+     171,     7,     8,     9,    10,    11,    12,    13,    14,    15,
+      16,    17,   180,    18,   177,   178,   104,   138,   171,   104,
+     185,     6,     6,   104,   152,   153,   156,   185,   165,   147,
+     185,   172,   173,   185,    21,   104,   171,   176,   103,    68,
+      68,   103,    47,    52,   134,   184,    94,   120,   121,   122,
+     114,     9,    37,    45,    73,    79,    82,    92,   117,   118,
+     119,   104,   168,   169,    17,     4,   171,   171,     9,    73,
+     104,   105,    95,   104,   104,    29,   154,   155,    58,    62,
+      67,    70,    83,   105,   149,   150,   151,   154,    59,   157,
+     104,   104,   105,   167,   103,   103,   184,     4,    53,    75,
+      76,    91,   186,   104,   105,   104,    33,    34,   129,   105,
+      73,   103,   177,    68,   185,   117,   171,     8,    73,   177,
+     103,   155,    67,    78,    67,   184,    67,    78,    67,    78,
+     153,   151,    35,    60,   158,   171,   104,   184,   184,   104,
+      47,    52,   103,   130,   120,   167,   103,     8,   171,   178,
+     184,    67,   184,    76,   184,    67,   184,    67,   176,   167,
+      77,   159,   104,   104,     4,   186,   124,   125,   126,   127,
+     128,   185,   104,   185,   171,   104,    76,   184,    76,   167,
+      76,   184,    76,   184,    35,    71,   160,    82,   104,   105,
+     103,   177,   185,   104,   167,    76,   167,   167,    76,   167,
+      76,   161,   162,   171,     6,   185,   125,   184,   167,   167,
+     167,   105,    30,    48,   163,   103,   104,   162,    74,   164,
+     184,    54,    69,   104
 };
 
-#define yyerrok		(yyerrstatus = 0)
-#define yyclearin	(yychar = YYEMPTY)
-#define YYEMPTY		(-2)
-#define YYEOF		0
+  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,   106,   107,   107,   107,   107,   108,   108,   108,   108,
+     108,   108,   108,   108,   108,   108,   109,   110,   110,   110,
+     110,   111,   112,   113,   114,   115,   115,   116,   116,   116,
+     116,   116,   116,   116,   116,   116,   116,   116,   116,   116,
+     116,   116,   116,   116,   116,   117,   117,   117,   117,   117,
+     117,   117,   118,   118,   119,   119,   120,   120,   120,   120,
+     121,   121,   122,   122,   123,   123,   124,   124,   125,   125,
+     125,   126,   127,   128,   129,   129,   130,   130,   131,   131,
+     132,   133,   133,   134,   134,   134,   134,   135,   136,   137,
+     137,   138,   139,   140,   140,   141,   141,   142,   143,   144,
+     144,   144,   145,   145,   146,   146,   147,   147,   147,   148,
+     149,   149,   150,   150,   151,   151,   151,   151,   151,   151,
+     151,   151,   152,   153,   153,   153,   154,   154,   155,   155,
+     156,   156,   157,   157,   158,   158,   159,   159,   160,   160,
+     161,   161,   162,   163,   163,   163,   164,   164,   164,   165,
+     165,   166,   167,   167,   168,   168,   169,   169,   170,   170,
+     170,   170,   170,   170,   170,   171,   171,   172,   172,   173,
+     173,   174,   174,   174,   174,   175,   175,   175,   176,   176,
+     177,   177,   177,   177,   177,   177,   177,   178,   178,   179,
+     179,   180,   180,   180,   180,   180,   180,   181,   182,   182,
+     183,   183,   184,   184,   185,   185,   186,   186,   186,   186
+};
 
-#define YYACCEPT	goto yyacceptlab
-#define YYABORT		goto yyabortlab
-#define YYERROR		goto yyerrorlab
+  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     2,     2,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     1,     6,     6,     6,
+       6,     7,     9,     3,     3,     1,     3,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     2,     2,     4,     4,     1,     2,     1,     2,     2,
+       4,     5,     2,     1,     0,     1,     4,     5,    10,     4,
+       3,     1,     0,     1,     0,     3,     1,     3,     1,     1,
+       1,     2,     4,     2,     1,     1,     0,     3,    10,     7,
+       5,     0,     4,     2,     2,     4,     4,     5,     4,     3,
+       1,     3,     2,     0,     2,     1,     3,     3,     9,     0,
+       1,     1,     1,     1,     1,     3,     3,     2,     1,     3,
+       0,     1,     2,     1,     5,     4,     6,     5,     6,     5,
+       6,     5,     3,     2,     2,     1,     1,     2,     1,     4,
+       1,     3,     0,     3,     0,     2,     0,     3,     0,     2,
+       1,     3,     3,     0,     1,     1,     0,     2,     2,     0,
+       1,     2,     3,     1,     3,     1,     2,     1,     5,     6,
+       4,     3,     3,     3,     3,     3,     1,     3,     1,     2,
+       1,     1,     1,     1,     3,     3,     4,     4,     1,     3,
+       1,     1,     2,     2,     1,     2,     2,     1,     3,     1,
+       3,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     3,     1,     1,     1,     1,     1,     1
+};
 
 
-/* Like YYERROR except do call yyerror.  This remains here temporarily
-   to ease the transition to the new meaning of YYERROR, for GCC.
-   Once GCC version 2 has supplanted version 1, this can go.  However,
-   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
-   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
-   discussed.  */
+#define yyerrok         (yyerrstatus = 0)
+#define yyclearin       (yychar = YYEMPTY)
+#define YYEMPTY         (-2)
+#define YYEOF           0
 
-#define YYFAIL		goto yyerrlab
-#if defined YYFAIL
-  /* This is here to suppress warnings from the GCC cpp's
-     -Wunused-macros.  Normally we don't worry about that warning, but
-     some users do, and we want to make it easy for users to remove
-     YYFAIL uses, which will produce warnings from Bison 2.5.  */
-#endif
+#define YYACCEPT        goto yyacceptlab
+#define YYABORT         goto yyabortlab
+#define YYERROR         goto yyerrorlab
+
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
@@ -1301,13 +1264,13 @@
   else                                                          \
     {                                                           \
       yyerror (&yylloc, yyscanner, parsedStatement, YY_("syntax error: cannot back up")); \
-      YYERROR;							\
-    }								\
-while (YYID (0))
+      YYERROR;                                                  \
+    }                                                           \
+while (0)
 
 /* Error token number */
-#define YYTERROR	1
-#define YYERRCODE	256
+#define YYTERROR        1
+#define YYERRCODE       256
 
 
 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
@@ -1317,7 +1280,7 @@
 #ifndef YYLLOC_DEFAULT
 # define YYLLOC_DEFAULT(Current, Rhs, N)                                \
     do                                                                  \
-      if (YYID (N))                                                     \
+      if (N)                                                            \
         {                                                               \
           (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
           (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
@@ -1331,12 +1294,27 @@
           (Current).first_column = (Current).last_column =              \
             YYRHSLOC (Rhs, 0).last_column;                              \
         }                                                               \
-    while (YYID (0))
+    while (0)
 #endif
 
 #define YYRHSLOC(Rhs, K) ((Rhs)[K])
 
 
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)                        \
+do {                                            \
+  if (yydebug)                                  \
+    YYFPRINTF Args;                             \
+} while (0)
+
+
 /* YY_LOCATION_PRINT -- Print the location on the stream.
    This macro was not mandated originally: define only if we know
    we won't break user code: when these are the locations we know.  */
@@ -1346,36 +1324,28 @@
 
 /* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
 
-__attribute__((__unused__))
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
+YY_ATTRIBUTE_UNUSED
 static unsigned
 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
-#else
-static unsigned
-yy_location_print_ (yyo, yylocp)
-    FILE *yyo;
-    YYLTYPE const * const yylocp;
-#endif
 {
   unsigned res = 0;
   int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
   if (0 <= yylocp->first_line)
     {
-      res += fprintf (yyo, "%d", yylocp->first_line);
+      res += YYFPRINTF (yyo, "%d", yylocp->first_line);
       if (0 <= yylocp->first_column)
-        res += fprintf (yyo, ".%d", yylocp->first_column);
+        res += YYFPRINTF (yyo, ".%d", yylocp->first_column);
     }
   if (0 <= yylocp->last_line)
     {
       if (yylocp->first_line < yylocp->last_line)
         {
-          res += fprintf (yyo, "-%d", yylocp->last_line);
+          res += YYFPRINTF (yyo, "-%d", yylocp->last_line);
           if (0 <= end_col)
-            res += fprintf (yyo, ".%d", end_col);
+            res += YYFPRINTF (yyo, ".%d", end_col);
         }
       else if (0 <= end_col && yylocp->first_column < end_col)
-        res += fprintf (yyo, "-%d", end_col);
+        res += YYFPRINTF (yyo, "-%d", end_col);
     }
   return res;
  }
@@ -1389,71 +1359,35 @@
 #endif
 
 
-/* YYLEX -- calling `yylex' with the right arguments.  */
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM)
-#else
-# define YYLEX yylex (&yylval, &yylloc, yyscanner)
-#endif
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-# ifndef YYFPRINTF
-#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#  define YYFPRINTF fprintf
-# endif
-
-# define YYDPRINTF(Args)			\
-do {						\
-  if (yydebug)					\
-    YYFPRINTF Args;				\
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
-do {									  \
-  if (yydebug)								  \
-    {									  \
-      YYFPRINTF (stderr, "%s ", Title);					  \
-      yy_symbol_print (stderr,						  \
-		  Type, Value, Location, yyscanner, parsedStatement); \
-      YYFPRINTF (stderr, "\n");						  \
-    }									  \
-} while (YYID (0))
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
+do {                                                                      \
+  if (yydebug)                                                            \
+    {                                                                     \
+      YYFPRINTF (stderr, "%s ", Title);                                   \
+      yy_symbol_print (stderr,                                            \
+                  Type, Value, Location, yyscanner, parsedStatement); \
+      YYFPRINTF (stderr, "\n");                                           \
+    }                                                                     \
+} while (0)
 
 
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT.  |
+`----------------------------------------*/
 
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, yyscan_t yyscanner, quickstep::ParseStatement **parsedStatement)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, yyscanner, parsedStatement)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    YYLTYPE const * const yylocationp;
-    yyscan_t yyscanner;
-    quickstep::ParseStatement **parsedStatement;
-#endif
 {
   FILE *yyo = yyoutput;
   YYUSE (yyo);
-  if (!yyvaluep)
-    return;
   YYUSE (yylocationp);
   YYUSE (yyscanner);
   YYUSE (parsedStatement);
+  if (!yyvaluep)
+    return;
 # ifdef YYPRINT
   if (yytype < YYNTOKENS)
     YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
-  YYUSE (yyoutput);
 # endif
   YYUSE (yytype);
 }
@@ -1463,25 +1397,11 @@
 | Print this symbol on YYOUTPUT.  |
 `--------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, yyscan_t yyscanner, quickstep::ParseStatement **parsedStatement)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, yyscanner, parsedStatement)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE const * const yyvaluep;
-    YYLTYPE const * const yylocationp;
-    yyscan_t yyscanner;
-    quickstep::ParseStatement **parsedStatement;
-#endif
 {
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
-  else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+  YYFPRINTF (yyoutput, "%s %s (",
+             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
 
   YY_LOCATION_PRINT (yyoutput, *yylocationp);
   YYFPRINTF (yyoutput, ": ");
@@ -1494,16 +1414,8 @@
 | TOP (included).                                                   |
 `------------------------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
-#else
-static void
-yy_stack_print (yybottom, yytop)
-    yytype_int16 *yybottom;
-    yytype_int16 *yytop;
-#endif
 {
   YYFPRINTF (stderr, "Stack now");
   for (; yybottom <= yytop; yybottom++)
@@ -1514,52 +1426,42 @@
   YYFPRINTF (stderr, "\n");
 }
 
-# define YY_STACK_PRINT(Bottom, Top)				\
-do {								\
-  if (yydebug)							\
-    yy_stack_print ((Bottom), (Top));				\
-} while (YYID (0))
+# define YY_STACK_PRINT(Bottom, Top)                            \
+do {                                                            \
+  if (yydebug)                                                  \
+    yy_stack_print ((Bottom), (Top));                           \
+} while (0)
 
 
 /*------------------------------------------------.
 | Report that the YYRULE is going to be reduced.  |
 `------------------------------------------------*/
 
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_reduce_print (YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, yyscan_t yyscanner, quickstep::ParseStatement **parsedStatement)
-#else
-static void
-yy_reduce_print (yyvsp, yylsp, yyrule, yyscanner, parsedStatement)
-    YYSTYPE *yyvsp;
-    YYLTYPE *yylsp;
-    int yyrule;
-    yyscan_t yyscanner;
-    quickstep::ParseStatement **parsedStatement;
-#endif
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, yyscan_t yyscanner, quickstep::ParseStatement **parsedStatement)
 {
+  unsigned long int yylno = yyrline[yyrule];
   int yynrhs = yyr2[yyrule];
   int yyi;
-  unsigned long int yylno = yyrline[yyrule];
   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
-	     yyrule - 1, yylno);
+             yyrule - 1, yylno);
   /* The symbols being reduced.  */
   for (yyi = 0; yyi < yynrhs; yyi++)
     {
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
-      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
-		       &(yyvsp[(yyi + 1) - (yynrhs)])
-		       , &(yylsp[(yyi + 1) - (yynrhs)])		       , yyscanner, parsedStatement);
+      yy_symbol_print (stderr,
+                       yystos[yyssp[yyi + 1 - yynrhs]],
+                       &(yyvsp[(yyi + 1) - (yynrhs)])
+                       , &(yylsp[(yyi + 1) - (yynrhs)])                       , yyscanner, parsedStatement);
       YYFPRINTF (stderr, "\n");
     }
 }
 
-# define YY_REDUCE_PRINT(Rule)		\
-do {					\
-  if (yydebug)				\
-    yy_reduce_print (yyvsp, yylsp, Rule, yyscanner, parsedStatement); \
-} while (YYID (0))
+# define YY_REDUCE_PRINT(Rule)          \
+do {                                    \
+  if (yydebug)                          \
+    yy_reduce_print (yyssp, yyvsp, yylsp, Rule, yyscanner, parsedStatement); \
+} while (0)
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
@@ -1573,7 +1475,7 @@
 
 
 /* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef	YYINITDEPTH
+#ifndef YYINITDEPTH
 # define YYINITDEPTH 200
 #endif
 
@@ -1596,15 +1498,8 @@
 #   define yystrlen strlen
 #  else
 /* Return the length of YYSTR.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static YYSIZE_T
 yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
-    const char *yystr;
-#endif
 {
   YYSIZE_T yylen;
   for (yylen = 0; yystr[yylen]; yylen++)
@@ -1620,16 +1515,8 @@
 #  else
 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    YYDEST.  */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static char *
 yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
-    char *yydest;
-    const char *yysrc;
-#endif
 {
   char *yyd = yydest;
   const char *yys = yysrc;
@@ -1659,27 +1546,27 @@
       char const *yyp = yystr;
 
       for (;;)
-	switch (*++yyp)
-	  {
-	  case '\'':
-	  case ',':
-	    goto do_not_strip_quotes;
+        switch (*++yyp)
+          {
+          case '\'':
+          case ',':
+            goto do_not_strip_quotes;
 
-	  case '\\':
-	    if (*++yyp != '\\')
-	      goto do_not_strip_quotes;
-	    /* Fall through.  */
-	  default:
-	    if (yyres)
-	      yyres[yyn] = *yyp;
-	    yyn++;
-	    break;
+          case '\\':
+            if (*++yyp != '\\')
+              goto do_not_strip_quotes;
+            /* Fall through.  */
+          default:
+            if (yyres)
+              yyres[yyn] = *yyp;
+            yyn++;
+            break;
 
-	  case '"':
-	    if (yyres)
-	      yyres[yyn] = '\0';
-	    return yyn;
-	  }
+          case '"':
+            if (yyres)
+              yyres[yyn] = '\0';
+            return yyn;
+          }
     do_not_strip_quotes: ;
     }
 
@@ -1702,11 +1589,11 @@
 yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
                 yytype_int16 *yyssp, int yytoken)
 {
-  YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
+  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
   YYSIZE_T yysize = yysize0;
   enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
   /* Internationalized format string. */
-  const char *yyformat = YY_NULL;
+  const char *yyformat = YY_NULLPTR;
   /* Arguments of yyformat. */
   char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
   /* Number of reported tokens (one for the "unexpected", one per
@@ -1714,10 +1601,6 @@
   int yycount = 0;
 
   /* There are many possibilities here to consider:
-     - Assume YYFAIL is not used.  It's too flawed to consider.  See
-       <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html>
-       for details.  YYERROR is fine as it does not invoke this
-       function.
      - If this state is a consistent state with a default action, then
        the only way this function was invoked is if the default action
        is an error action.  In that case, don't check for expected
@@ -1767,7 +1650,7 @@
                   }
                 yyarg[yycount++] = yytname[yyx];
                 {
-                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
                   if (! (yysize <= yysize1
                          && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
                     return 2;
@@ -1834,754 +1717,765 @@
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 static void
 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, yyscan_t yyscanner, quickstep::ParseStatement **parsedStatement)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep, yylocationp, yyscanner, parsedStatement)
-    const char *yymsg;
-    int yytype;
-    YYSTYPE *yyvaluep;
-    YYLTYPE *yylocationp;
-    yyscan_t yyscanner;
-    quickstep::ParseStatement **parsedStatement;
-#endif
 {
   YYUSE (yyvaluep);
   YYUSE (yylocationp);
   YYUSE (yyscanner);
   YYUSE (parsedStatement);
-
   if (!yymsg)
     yymsg = "Deleting";
   YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
 
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   switch (yytype)
     {
-      case 3: /* TOKEN_NAME */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+          case 3: /* TOKEN_NAME  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).string_value_) != nullptr) {
     delete ((*yyvaluep).string_value_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1874 "SqlParser_gen.cpp"
+}
+#line 1742 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 4: /* TOKEN_STRING_SINGLE_QUOTED */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 4: /* TOKEN_STRING_SINGLE_QUOTED  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).string_value_) != nullptr) {
     delete ((*yyvaluep).string_value_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1885 "SqlParser_gen.cpp"
+}
+#line 1752 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 5: /* TOKEN_STRING_DOUBLE_QUOTED */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 5: /* TOKEN_STRING_DOUBLE_QUOTED  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).string_value_) != nullptr) {
     delete ((*yyvaluep).string_value_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1896 "SqlParser_gen.cpp"
+}
+#line 1762 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 6: /* TOKEN_UNSIGNED_NUMVAL */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 6: /* TOKEN_UNSIGNED_NUMVAL  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).numeric_literal_value_) != nullptr) {
     delete ((*yyvaluep).numeric_literal_value_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1907 "SqlParser_gen.cpp"
+}
+#line 1772 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 104: /* sql_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 108: /* sql_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).statement_) != nullptr) {
     delete ((*yyvaluep).statement_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1918 "SqlParser_gen.cpp"
+}
+#line 1782 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 105: /* quit_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 109: /* quit_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).quit_statement_) != nullptr) {
     delete ((*yyvaluep).quit_statement_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1929 "SqlParser_gen.cpp"
+}
+#line 1792 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 106: /* alter_table_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 110: /* alter_table_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).statement_) != nullptr) {
     delete ((*yyvaluep).statement_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1940 "SqlParser_gen.cpp"
+}
+#line 1802 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 107: /* create_table_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 111: /* create_table_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).create_table_statement_) != nullptr) {
     delete ((*yyvaluep).create_table_statement_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1951 "SqlParser_gen.cpp"
+}
+#line 1812 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 108: /* drop_table_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 112: /* create_index_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).statement_) != nullptr) {
+    delete ((*yyvaluep).statement_);
+  }
+}
+#line 1822 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 113: /* drop_table_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).drop_table_statement_) != nullptr) {
     delete ((*yyvaluep).drop_table_statement_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1962 "SqlParser_gen.cpp"
+}
+#line 1832 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 109: /* column_def */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 114: /* column_def  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).attribute_definition_) != nullptr) {
     delete ((*yyvaluep).attribute_definition_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1973 "SqlParser_gen.cpp"
+}
+#line 1842 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 110: /* column_def_commalist */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 115: /* column_def_commalist  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).attribute_definition_list_) != nullptr) {
     delete ((*yyvaluep).attribute_definition_list_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1984 "SqlParser_gen.cpp"
+}
+#line 1852 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 111: /* data_type */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 116: /* data_type  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).data_type_) != nullptr) {
     delete ((*yyvaluep).data_type_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 1995 "SqlParser_gen.cpp"
+}
+#line 1862 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 112: /* column_constraint_def */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 117: /* column_constraint_def  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).column_constraint_) != nullptr) {
     delete ((*yyvaluep).column_constraint_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 2006 "SqlParser_gen.cpp"
+}
+#line 1872 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 113: /* column_constraint_def_list */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 118: /* column_constraint_def_list  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).column_constraint_list_) != nullptr) {
     delete ((*yyvaluep).column_constraint_list_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 2017 "SqlParser_gen.cpp"
+}
+#line 1882 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 114: /* opt_column_constraint_def_list */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 119: /* opt_column_constraint_def_list  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).column_constraint_list_) != nullptr) {
     delete ((*yyvaluep).column_constraint_list_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 2028 "SqlParser_gen.cpp"
+}
+#line 1892 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 118: /* insert_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).insert_statement_) != nullptr) {
-    delete ((*yyvaluep).insert_statement_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2039 "SqlParser_gen.cpp"
-        break;
-      case 119: /* copy_from_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).copy_from_statement_) != nullptr) {
-    delete ((*yyvaluep).copy_from_statement_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2050 "SqlParser_gen.cpp"
-        break;
-      case 120: /* opt_copy_from_params */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).copy_from_params_) != nullptr) {
-    delete ((*yyvaluep).copy_from_params_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2061 "SqlParser_gen.cpp"
-        break;
-      case 121: /* copy_from_params */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).copy_from_params_) != nullptr) {
-    delete ((*yyvaluep).copy_from_params_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2072 "SqlParser_gen.cpp"
-        break;
-      case 122: /* update_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).update_statement_) != nullptr) {
-    delete ((*yyvaluep).update_statement_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2083 "SqlParser_gen.cpp"
-        break;
-      case 123: /* delete_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).delete_statement_) != nullptr) {
-    delete ((*yyvaluep).delete_statement_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2094 "SqlParser_gen.cpp"
-        break;
-      case 124: /* assignment_list */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).assignment_list_) != nullptr) {
-    delete ((*yyvaluep).assignment_list_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2105 "SqlParser_gen.cpp"
-        break;
-      case 125: /* assignment_item */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).assignment_) != nullptr) {
-    delete ((*yyvaluep).assignment_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2116 "SqlParser_gen.cpp"
-        break;
-      case 126: /* select_statement */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).select_statement_) != nullptr) {
-    delete ((*yyvaluep).select_statement_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2127 "SqlParser_gen.cpp"
-        break;
-      case 127: /* opt_with_clause */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).with_list_) != nullptr) {
-    delete ((*yyvaluep).with_list_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2138 "SqlParser_gen.cpp"
-        break;
-      case 128: /* with_list */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).with_list_) != nullptr) {
-    delete ((*yyvaluep).with_list_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2149 "SqlParser_gen.cpp"
-        break;
-      case 129: /* with_list_element */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).with_list_element_) != nullptr) {
-    delete ((*yyvaluep).with_list_element_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2160 "SqlParser_gen.cpp"
-        break;
-      case 130: /* select_query */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).select_query_) != nullptr) {
-    delete ((*yyvaluep).select_query_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2171 "SqlParser_gen.cpp"
-        break;
-      case 132: /* selection */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).selection_) != nullptr) {
-    delete ((*yyvaluep).selection_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2182 "SqlParser_gen.cpp"
-        break;
-      case 133: /* selection_item_commalist */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).selection_list_) != nullptr) {
-    delete ((*yyvaluep).selection_list_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2193 "SqlParser_gen.cpp"
-        break;
-      case 134: /* selection_item */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).selection_item_) != nullptr) {
-    delete ((*yyvaluep).selection_item_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2204 "SqlParser_gen.cpp"
-        break;
-      case 135: /* from_clause */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).table_reference_list_) != nullptr) {
-    delete ((*yyvaluep).table_reference_list_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2215 "SqlParser_gen.cpp"
-        break;
-      case 139: /* subquery_expression */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).subquery_expression_) != nullptr) {
-    delete ((*yyvaluep).subquery_expression_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2226 "SqlParser_gen.cpp"
-        break;
-      case 140: /* table_reference */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).table_reference_) != nullptr) {
-    delete ((*yyvaluep).table_reference_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2237 "SqlParser_gen.cpp"
-        break;
-      case 141: /* table_reference_signature */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).table_reference_signature_) != nullptr) {
-    delete ((*yyvaluep).table_reference_signature_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2248 "SqlParser_gen.cpp"
-        break;
-      case 142: /* table_reference_signature_primary */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).table_reference_signature_) != nullptr) {
-    delete ((*yyvaluep).table_reference_signature_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2259 "SqlParser_gen.cpp"
-        break;
-      case 143: /* table_reference_commalist */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).table_reference_list_) != nullptr) {
-    delete ((*yyvaluep).table_reference_list_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2270 "SqlParser_gen.cpp"
-        break;
-      case 144: /* opt_group_by_clause */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).opt_group_by_clause_) != nullptr) {
-    delete ((*yyvaluep).opt_group_by_clause_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2281 "SqlParser_gen.cpp"
-        break;
-      case 145: /* opt_having_clause */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).opt_having_clause_) != nullptr) {
-    delete ((*yyvaluep).opt_having_clause_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2292 "SqlParser_gen.cpp"
-        break;
-      case 146: /* opt_order_by_clause */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).opt_order_by_clause_) != nullptr) {
-    delete ((*yyvaluep).opt_order_by_clause_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2303 "SqlParser_gen.cpp"
-        break;
-      case 147: /* opt_limit_clause */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).opt_limit_clause_) != nullptr) {
-    delete ((*yyvaluep).opt_limit_clause_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2314 "SqlParser_gen.cpp"
-        break;
-      case 148: /* order_commalist */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).order_commalist_) != nullptr) {
-    delete ((*yyvaluep).order_commalist_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2325 "SqlParser_gen.cpp"
-        break;
-      case 149: /* order_item */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).order_item_) != nullptr) {
-    delete ((*yyvaluep).order_item_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2336 "SqlParser_gen.cpp"
-        break;
-      case 150: /* opt_order_direction */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).order_direction_) != nullptr) {
-    delete ((*yyvaluep).order_direction_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2347 "SqlParser_gen.cpp"
-        break;
-      case 151: /* opt_nulls_first */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).order_direction_) != nullptr) {
-    delete ((*yyvaluep).order_direction_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2358 "SqlParser_gen.cpp"
-        break;
-      case 152: /* opt_where_clause */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).predicate_) != nullptr) {
-    delete ((*yyvaluep).predicate_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2369 "SqlParser_gen.cpp"
-        break;
-      case 153: /* where_clause */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).predicate_) != nullptr) {
-    delete ((*yyvaluep).predicate_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2380 "SqlParser_gen.cpp"
-        break;
-      case 154: /* or_expression */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).predicate_) != nullptr) {
-    delete ((*yyvaluep).predicate_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2391 "SqlParser_gen.cpp"
-        break;
-      case 155: /* and_expression */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).predicate_) != nullptr) {
-    delete ((*yyvaluep).predicate_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2402 "SqlParser_gen.cpp"
-        break;
-      case 156: /* not_expression */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).predicate_) != nullptr) {
-    delete ((*yyvaluep).predicate_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2413 "SqlParser_gen.cpp"
-        break;
-      case 157: /* predicate_expression_base */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).predicate_) != nullptr) {
-    delete ((*yyvaluep).predicate_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2424 "SqlParser_gen.cpp"
-        break;
-      case 158: /* add_expression */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).expression_) != nullptr) {
-    delete ((*yyvaluep).expression_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2435 "SqlParser_gen.cpp"
-        break;
-      case 159: /* multiply_expression */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).expression_) != nullptr) {
-    delete ((*yyvaluep).expression_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2446 "SqlParser_gen.cpp"
-        break;
-      case 160: /* unary_expression */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).expression_) != nullptr) {
-    delete ((*yyvaluep).expression_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2457 "SqlParser_gen.cpp"
-        break;
-      case 161: /* expression_base */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).expression_) != nullptr) {
-    delete ((*yyvaluep).expression_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2468 "SqlParser_gen.cpp"
-        break;
-      case 162: /* function_call */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).function_call_) != nullptr) {
-    delete ((*yyvaluep).function_call_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2479 "SqlParser_gen.cpp"
-        break;
-      case 163: /* expression_list */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).expression_list_) != nullptr) {
-    delete ((*yyvaluep).expression_list_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2490 "SqlParser_gen.cpp"
-        break;
-      case 164: /* literal_value */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).literal_value_) != nullptr) {
-    delete ((*yyvaluep).literal_value_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2501 "SqlParser_gen.cpp"
-        break;
-      case 165: /* literal_value_commalist */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).literal_value_list_) != nullptr) {
-    delete ((*yyvaluep).literal_value_list_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2512 "SqlParser_gen.cpp"
-        break;
-      case 166: /* attribute_ref */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
-  if (((*yyvaluep).attribute_) != nullptr) {
-    delete ((*yyvaluep).attribute_);
-  }
-};
-/* Line 1393 of yacc.c  */
-#line 2523 "SqlParser_gen.cpp"
-        break;
-      case 167: /* comparison_operation */
-/* Line 1393 of yacc.c  */
-#line 446 "../SqlParser.ypp"
-        { };
-/* Line 1393 of yacc.c  */
-#line 2530 "SqlParser_gen.cpp"
-        break;
-      case 168: /* unary_operation */
-/* Line 1393 of yacc.c  */
-#line 447 "../SqlParser.ypp"
-        { };
-/* Line 1393 of yacc.c  */
-#line 2537 "SqlParser_gen.cpp"
-        break;
-      case 169: /* add_operation */
-/* Line 1393 of yacc.c  */
-#line 448 "../SqlParser.ypp"
-        { };
-/* Line 1393 of yacc.c  */
-#line 2544 "SqlParser_gen.cpp"
-        break;
-      case 170: /* multiply_operation */
-/* Line 1393 of yacc.c  */
-#line 448 "../SqlParser.ypp"
-        { };
-/* Line 1393 of yacc.c  */
-#line 2551 "SqlParser_gen.cpp"
-        break;
-      case 171: /* name_commalist */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 123: /* opt_column_list  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).string_list_) != nullptr) {
     delete ((*yyvaluep).string_list_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 2562 "SqlParser_gen.cpp"
+}
+#line 1902 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 172: /* any_name */
-/* Line 1393 of yacc.c  */
-#line 450 "../SqlParser.ypp"
-        {
+
+    case 124: /* key_value_list  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).key_value_list_) != nullptr) {
+    delete ((*yyvaluep).key_value_list_);
+  }
+}
+#line 1912 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 125: /* key_value  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).key_value_) != nullptr) {
+    delete ((*yyvaluep).key_value_);
+  }
+}
+#line 1922 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 126: /* key_string_value  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).key_string_value_) != nullptr) {
+    delete ((*yyvaluep).key_string_value_);
+  }
+}
+#line 1932 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 127: /* key_string_list  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).key_string_list_) != nullptr) {
+    delete ((*yyvaluep).key_string_list_);
+  }
+}
+#line 1942 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 128: /* key_literal_value  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).key_literal_value_) != nullptr) {
+    delete ((*yyvaluep).key_literal_value_);
+  }
+}
+#line 1952 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 129: /* index_type  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
   if (((*yyvaluep).string_value_) != nullptr) {
     delete ((*yyvaluep).string_value_);
   }
-};
-/* Line 1393 of yacc.c  */
-#line 2573 "SqlParser_gen.cpp"
+}
+#line 1962 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
-      case 173: /* boolean_value */
-/* Line 1393 of yacc.c  */
-#line 445 "../SqlParser.ypp"
-        { };
-/* Line 1393 of yacc.c  */
-#line 2580 "SqlParser_gen.cpp"
+
+    case 130: /* opt_index_properties  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).key_value_list_) != nullptr) {
+    delete ((*yyvaluep).key_value_list_);
+  }
+}
+#line 1972 "SqlParser_gen.cpp" /* yacc.c:1257  */
         break;
 
+    case 131: /* insert_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).insert_statement_) != nullptr) {
+    delete ((*yyvaluep).insert_statement_);
+  }
+}
+#line 1982 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 132: /* copy_from_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).copy_from_statement_) != nullptr) {
+    delete ((*yyvaluep).copy_from_statement_);
+  }
+}
+#line 1992 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 133: /* opt_copy_from_params  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).copy_from_params_) != nullptr) {
+    delete ((*yyvaluep).copy_from_params_);
+  }
+}
+#line 2002 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 134: /* copy_from_params  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).copy_from_params_) != nullptr) {
+    delete ((*yyvaluep).copy_from_params_);
+  }
+}
+#line 2012 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 135: /* update_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).update_statement_) != nullptr) {
+    delete ((*yyvaluep).update_statement_);
+  }
+}
+#line 2022 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 136: /* delete_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).delete_statement_) != nullptr) {
+    delete ((*yyvaluep).delete_statement_);
+  }
+}
+#line 2032 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 137: /* assignment_list  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).assignment_list_) != nullptr) {
+    delete ((*yyvaluep).assignment_list_);
+  }
+}
+#line 2042 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 138: /* assignment_item  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).assignment_) != nullptr) {
+    delete ((*yyvaluep).assignment_);
+  }
+}
+#line 2052 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 139: /* select_statement  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).select_statement_) != nullptr) {
+    delete ((*yyvaluep).select_statement_);
+  }
+}
+#line 2062 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 140: /* opt_with_clause  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).with_list_) != nullptr) {
+    delete ((*yyvaluep).with_list_);
+  }
+}
+#line 2072 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 141: /* with_list  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).with_list_) != nullptr) {
+    delete ((*yyvaluep).with_list_);
+  }
+}
+#line 2082 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 142: /* with_list_element  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).with_list_element_) != nullptr) {
+    delete ((*yyvaluep).with_list_element_);
+  }
+}
+#line 2092 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 143: /* select_query  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).select_query_) != nullptr) {
+    delete ((*yyvaluep).select_query_);
+  }
+}
+#line 2102 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 145: /* selection  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).selection_) != nullptr) {
+    delete ((*yyvaluep).selection_);
+  }
+}
+#line 2112 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 146: /* selection_item_commalist  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).selection_list_) != nullptr) {
+    delete ((*yyvaluep).selection_list_);
+  }
+}
+#line 2122 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 147: /* selection_item  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).selection_item_) != nullptr) {
+    delete ((*yyvaluep).selection_item_);
+  }
+}
+#line 2132 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 148: /* from_clause  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).table_reference_list_) != nullptr) {
+    delete ((*yyvaluep).table_reference_list_);
+  }
+}
+#line 2142 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 152: /* subquery_expression  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).subquery_expression_) != nullptr) {
+    delete ((*yyvaluep).subquery_expression_);
+  }
+}
+#line 2152 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 153: /* table_reference  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).table_reference_) != nullptr) {
+    delete ((*yyvaluep).table_reference_);
+  }
+}
+#line 2162 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 154: /* table_reference_signature  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).table_reference_signature_) != nullptr) {
+    delete ((*yyvaluep).table_reference_signature_);
+  }
+}
+#line 2172 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 155: /* table_reference_signature_primary  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).table_reference_signature_) != nullptr) {
+    delete ((*yyvaluep).table_reference_signature_);
+  }
+}
+#line 2182 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 156: /* table_reference_commalist  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).table_reference_list_) != nullptr) {
+    delete ((*yyvaluep).table_reference_list_);
+  }
+}
+#line 2192 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 157: /* opt_group_by_clause  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).opt_group_by_clause_) != nullptr) {
+    delete ((*yyvaluep).opt_group_by_clause_);
+  }
+}
+#line 2202 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 158: /* opt_having_clause  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).opt_having_clause_) != nullptr) {
+    delete ((*yyvaluep).opt_having_clause_);
+  }
+}
+#line 2212 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 159: /* opt_order_by_clause  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).opt_order_by_clause_) != nullptr) {
+    delete ((*yyvaluep).opt_order_by_clause_);
+  }
+}
+#line 2222 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 160: /* opt_limit_clause  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).opt_limit_clause_) != nullptr) {
+    delete ((*yyvaluep).opt_limit_clause_);
+  }
+}
+#line 2232 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 161: /* order_commalist  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).order_commalist_) != nullptr) {
+    delete ((*yyvaluep).order_commalist_);
+  }
+}
+#line 2242 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 162: /* order_item  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).order_item_) != nullptr) {
+    delete ((*yyvaluep).order_item_);
+  }
+}
+#line 2252 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 163: /* opt_order_direction  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).order_direction_) != nullptr) {
+    delete ((*yyvaluep).order_direction_);
+  }
+}
+#line 2262 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 164: /* opt_nulls_first  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).order_direction_) != nullptr) {
+    delete ((*yyvaluep).order_direction_);
+  }
+}
+#line 2272 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 165: /* opt_where_clause  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).predicate_) != nullptr) {
+    delete ((*yyvaluep).predicate_);
+  }
+}
+#line 2282 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 166: /* where_clause  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).predicate_) != nullptr) {
+    delete ((*yyvaluep).predicate_);
+  }
+}
+#line 2292 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 167: /* or_expression  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).predicate_) != nullptr) {
+    delete ((*yyvaluep).predicate_);
+  }
+}
+#line 2302 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 168: /* and_expression  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).predicate_) != nullptr) {
+    delete ((*yyvaluep).predicate_);
+  }
+}
+#line 2312 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 169: /* not_expression  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).predicate_) != nullptr) {
+    delete ((*yyvaluep).predicate_);
+  }
+}
+#line 2322 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 170: /* predicate_expression_base  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).predicate_) != nullptr) {
+    delete ((*yyvaluep).predicate_);
+  }
+}
+#line 2332 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 171: /* add_expression  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).expression_) != nullptr) {
+    delete ((*yyvaluep).expression_);
+  }
+}
+#line 2342 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 172: /* multiply_expression  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).expression_) != nullptr) {
+    delete ((*yyvaluep).expression_);
+  }
+}
+#line 2352 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 173: /* unary_expression  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).expression_) != nullptr) {
+    delete ((*yyvaluep).expression_);
+  }
+}
+#line 2362 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 174: /* expression_base  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).expression_) != nullptr) {
+    delete ((*yyvaluep).expression_);
+  }
+}
+#line 2372 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 175: /* function_call  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).function_call_) != nullptr) {
+    delete ((*yyvaluep).function_call_);
+  }
+}
+#line 2382 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 176: /* expression_list  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).expression_list_) != nullptr) {
+    delete ((*yyvaluep).expression_list_);
+  }
+}
+#line 2392 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 177: /* literal_value  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).literal_value_) != nullptr) {
+    delete ((*yyvaluep).literal_value_);
+  }
+}
+#line 2402 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 178: /* literal_value_commalist  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).literal_value_list_) != nullptr) {
+    delete ((*yyvaluep).literal_value_list_);
+  }
+}
+#line 2412 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 179: /* attribute_ref  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).attribute_) != nullptr) {
+    delete ((*yyvaluep).attribute_);
+  }
+}
+#line 2422 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 180: /* comparison_operation  */
+#line 478 "../SqlParser.ypp" /* yacc.c:1257  */
+      { }
+#line 2428 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 181: /* unary_operation  */
+#line 479 "../SqlParser.ypp" /* yacc.c:1257  */
+      { }
+#line 2434 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 182: /* add_operation  */
+#line 480 "../SqlParser.ypp" /* yacc.c:1257  */
+      { }
+#line 2440 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 183: /* multiply_operation  */
+#line 480 "../SqlParser.ypp" /* yacc.c:1257  */
+      { }
+#line 2446 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 184: /* name_commalist  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).string_list_) != nullptr) {
+    delete ((*yyvaluep).string_list_);
+  }
+}
+#line 2456 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 185: /* any_name  */
+#line 482 "../SqlParser.ypp" /* yacc.c:1257  */
+      {
+  if (((*yyvaluep).string_value_) != nullptr) {
+    delete ((*yyvaluep).string_value_);
+  }
+}
+#line 2466 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+    case 186: /* boolean_value  */
+#line 477 "../SqlParser.ypp" /* yacc.c:1257  */
+      { }
+#line 2472 "SqlParser_gen.cpp" /* yacc.c:1257  */
+        break;
+
+
       default:
         break;
     }
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
 
@@ -2591,67 +2485,27 @@
 | yyparse.  |
 `----------*/
 
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
-    void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
-     || defined __cplusplus || defined _MSC_VER)
 int
 yyparse (yyscan_t yyscanner, quickstep::ParseStatement **parsedStatement)
-#else
-int
-yyparse (yyscanner, parsedStatement)
-    yyscan_t yyscanner;
-    quickstep::ParseStatement **parsedStatement;
-#endif
-#endif
 {
 /* The lookahead symbol.  */
 int yychar;
 
 
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
-    _Pragma ("GCC diagnostic push") \
-    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
-    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
-    _Pragma ("GCC diagnostic pop")
-#else
+/* The semantic value of the lookahead symbol.  */
 /* Default value used for initialization, for pacifying older GCCs
    or non-GCC compilers.  */
-static YYSTYPE yyval_default;
-# define YY_INITIAL_VALUE(Value) = Value
-#endif
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
+
+/* Location data for the lookahead symbol.  */
 static YYLTYPE yyloc_default
 # if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
   = { 1, 1, 1, 1 }
 # endif
 ;
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-# define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
-/* The semantic value of the lookahead symbol.  */
-YYSTYPE yylval YY_INITIAL_VALUE(yyval_default);
-
-/* Location data for the lookahead symbol.  */
 YYLTYPE yylloc = yyloc_default;
 
-
     /* Number of syntax errors so far.  */
     int yynerrs;
 
@@ -2660,9 +2514,9 @@
     int yyerrstatus;
 
     /* The stacks and their tools:
-       `yyss': related to states.
-       `yyvs': related to semantic values.
-       `yyls': related to locations.
+       'yyss': related to states.
+       'yyvs': related to semantic values.
+       'yyls': related to locations.
 
        Refer to the stacks through separate pointers, to allow yyoverflow
        to reallocate them elsewhere.  */
@@ -2741,26 +2595,26 @@
 
 #ifdef yyoverflow
       {
-	/* Give user a chance to reallocate the stack.  Use copies of
-	   these so that the &'s don't force the real ones into
-	   memory.  */
-	YYSTYPE *yyvs1 = yyvs;
-	yytype_int16 *yyss1 = yyss;
-	YYLTYPE *yyls1 = yyls;
+        /* Give user a chance to reallocate the stack.  Use copies of
+           these so that the &'s don't force the real ones into
+           memory.  */
+        YYSTYPE *yyvs1 = yyvs;
+        yytype_int16 *yyss1 = yyss;
+        YYLTYPE *yyls1 = yyls;
 
-	/* Each stack pointer address is followed by the size of the
-	   data in use in that stack, in bytes.  This used to be a
-	   conditional around just the two extra args, but that might
-	   be undefined if yyoverflow is a macro.  */
-	yyoverflow (YY_("memory exhausted"),
-		    &yyss1, yysize * sizeof (*yyssp),
-		    &yyvs1, yysize * sizeof (*yyvsp),
-		    &yyls1, yysize * sizeof (*yylsp),
-		    &yystacksize);
+        /* Each stack pointer address is followed by the size of the
+           data in use in that stack, in bytes.  This used to be a
+           conditional around just the two extra args, but that might
+           be undefined if yyoverflow is a macro.  */
+        yyoverflow (YY_("memory exhausted"),
+                    &yyss1, yysize * sizeof (*yyssp),
+                    &yyvs1, yysize * sizeof (*yyvsp),
+                    &yyls1, yysize * sizeof (*yylsp),
+                    &yystacksize);
 
-	yyls = yyls1;
-	yyss = yyss1;
-	yyvs = yyvs1;
+        yyls = yyls1;
+        yyss = yyss1;
+        yyvs = yyvs1;
       }
 #else /* no yyoverflow */
 # ifndef YYSTACK_RELOCATE
@@ -2768,23 +2622,23 @@
 # else
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-	goto yyexhaustedlab;
+        goto yyexhaustedlab;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
-	yystacksize = YYMAXDEPTH;
+        yystacksize = YYMAXDEPTH;
 
       {
-	yytype_int16 *yyss1 = yyss;
-	union yyalloc *yyptr =
-	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
-	if (! yyptr)
-	  goto yyexhaustedlab;
-	YYSTACK_RELOCATE (yyss_alloc, yyss);
-	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
-	YYSTACK_RELOCATE (yyls_alloc, yyls);
+        yytype_int16 *yyss1 = yyss;
+        union yyalloc *yyptr =
+          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+        if (! yyptr)
+          goto yyexhaustedlab;
+        YYSTACK_RELOCATE (yyss_alloc, yyss);
+        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+        YYSTACK_RELOCATE (yyls_alloc, yyls);
 #  undef YYSTACK_RELOCATE
-	if (yyss1 != yyssa)
-	  YYSTACK_FREE (yyss1);
+        if (yyss1 != yyssa)
+          YYSTACK_FREE (yyss1);
       }
 # endif
 #endif /* no yyoverflow */
@@ -2794,10 +2648,10 @@
       yylsp = yyls + yysize - 1;
 
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-		  (unsigned long int) yystacksize));
+                  (unsigned long int) yystacksize));
 
       if (yyss + yystacksize - 1 <= yyssp)
-	YYABORT;
+        YYABORT;
     }
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
@@ -2826,7 +2680,7 @@
   if (yychar == YYEMPTY)
     {
       YYDPRINTF ((stderr, "Reading a token: "));
-      yychar = YYLEX;
+      yychar = yylex (&yylval, &yylloc, yyscanner);
     }
 
   if (yychar <= YYEOF)
@@ -2891,7 +2745,7 @@
   yylen = yyr2[yyn];
 
   /* If YYLEN is nonzero, implement the default value of the action:
-     `$$ = $1'.
+     '$$ = $1'.
 
      Otherwise, the following line sets YYVAL to garbage.
      This behavior is undocumented and Bison
@@ -2906,320 +2760,342 @@
   switch (yyn)
     {
         case 2:
-/* Line 1787 of yacc.c  */
-#line 459 "../SqlParser.ypp"
+#line 491 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    *parsedStatement = (yyvsp[(1) - (2)].statement_);
+    *parsedStatement = (yyvsp[-1].statement_);
     YYACCEPT;
   }
+#line 2769 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 3:
-/* Line 1787 of yacc.c  */
-#line 463 "../SqlParser.ypp"
+#line 495 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    *parsedStatement = (yyvsp[(1) - (2)].statement_);
+    *parsedStatement = (yyvsp[-1].statement_);
     YYACCEPT;
   }
+#line 2778 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 4:
-/* Line 1787 of yacc.c  */
-#line 467 "../SqlParser.ypp"
+#line 499 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     YYABORT;
   }
+#line 2786 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 5:
-/* Line 1787 of yacc.c  */
-#line 470 "../SqlParser.ypp"
+#line 502 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     // Regular yyparse() return codes are non-negative, so use a negative one here.
     return -1;
   }
+#line 2795 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 6:
-/* Line 1787 of yacc.c  */
-#line 477 "../SqlParser.ypp"
+#line 509 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.statement_) = (yyvsp[(1) - (1)].statement_);
+    (yyval.statement_) = (yyvsp[0].statement_);
   }
+#line 2803 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 7:
-/* Line 1787 of yacc.c  */
-#line 480 "../SqlParser.ypp"
+#line 512 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.statement_) = (yyvsp[(1) - (1)].copy_from_statement_);
+    (yyval.statement_) = (yyvsp[0].copy_from_statement_);
   }
+#line 2811 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 8:
-/* Line 1787 of yacc.c  */
-#line 483 "../SqlParser.ypp"
+#line 515 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.statement_) = (yyvsp[(1) - (1)].create_table_statement_);
+    (yyval.statement_) = (yyvsp[0].create_table_statement_);
   }
+#line 2819 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 9:
-/* Line 1787 of yacc.c  */
-#line 486 "../SqlParser.ypp"
+#line 518 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.statement_) = (yyvsp[(1) - (1)].delete_statement_);
+    (yyval.statement_) = (yyvsp[0].statement_);
   }
+#line 2827 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 10:
-/* Line 1787 of yacc.c  */
-#line 489 "../SqlParser.ypp"
+#line 521 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.statement_) = (yyvsp[(1) - (1)].drop_table_statement_);
+    (yyval.statement_) = (yyvsp[0].delete_statement_);
   }
+#line 2835 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 11:
-/* Line 1787 of yacc.c  */
-#line 492 "../SqlParser.ypp"
+#line 524 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.statement_) = (yyvsp[(1) - (1)].insert_statement_);
+    (yyval.statement_) = (yyvsp[0].drop_table_statement_);
   }
+#line 2843 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 12:
-/* Line 1787 of yacc.c  */
-#line 495 "../SqlParser.ypp"
+#line 527 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.statement_) = (yyvsp[(1) - (1)].quit_statement_);
+    (yyval.statement_) = (yyvsp[0].insert_statement_);
   }
+#line 2851 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 13:
-/* Line 1787 of yacc.c  */
-#line 498 "../SqlParser.ypp"
+#line 530 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.statement_) = (yyvsp[(1) - (1)].select_statement_);
+    (yyval.statement_) = (yyvsp[0].quit_statement_);
   }
+#line 2859 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 14:
-/* Line 1787 of yacc.c  */
-#line 501 "../SqlParser.ypp"
+#line 533 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.statement_) = (yyvsp[(1) - (1)].update_statement_);
+    (yyval.statement_) = (yyvsp[0].select_statement_);
   }
+#line 2867 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 15:
-/* Line 1787 of yacc.c  */
-#line 507 "../SqlParser.ypp"
+#line 536 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.quit_statement_) = new quickstep::ParseStatementQuit((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column);
+    (yyval.statement_) = (yyvsp[0].update_statement_);
   }
+#line 2875 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 16:
-/* Line 1787 of yacc.c  */
-#line 513 "../SqlParser.ypp"
+#line 542 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    delete (yyvsp[(3) - (6)].string_value_);
-    delete (yyvsp[(6) - (6)].attribute_definition_);
-    (yyval.statement_) = nullptr;
-    NotSupported(&(yylsp[(1) - (6)]), yyscanner, "ALTER statements");
-    YYERROR;
+    (yyval.quit_statement_) = new quickstep::ParseStatementQuit((yylsp[0]).first_line, (yylsp[0]).first_column);
   }
+#line 2883 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 17:
-/* Line 1787 of yacc.c  */
-#line 520 "../SqlParser.ypp"
+#line 548 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    delete (yyvsp[(3) - (6)].string_value_);
+    delete (yyvsp[-3].string_value_);
+    delete (yyvsp[0].attribute_definition_);
     (yyval.statement_) = nullptr;
-    NotSupported(&(yylsp[(1) - (6)]), yyscanner, "ALTER statements");
+    NotSupported(&(yylsp[-5]), yyscanner, "ALTER statements");
     YYERROR;
   }
+#line 2895 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 18:
-/* Line 1787 of yacc.c  */
-#line 526 "../SqlParser.ypp"
+#line 555 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    delete (yyvsp[(3) - (6)].string_value_);
-    delete (yyvsp[(6) - (6)].string_value_);
+    delete (yyvsp[-3].string_value_);
     (yyval.statement_) = nullptr;
-    NotSupported(&(yylsp[(1) - (6)]), yyscanner, "ALTER statements");
+    NotSupported(&(yylsp[-5]), yyscanner, "ALTER statements");
     YYERROR;
   }
+#line 2906 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 19:
-/* Line 1787 of yacc.c  */
-#line 533 "../SqlParser.ypp"
+#line 561 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    delete (yyvsp[(3) - (6)].string_value_);
-    delete (yyvsp[(6) - (6)].string_value_);
+    delete (yyvsp[-3].string_value_);
+    delete (yyvsp[0].string_value_);
     (yyval.statement_) = nullptr;
-    NotSupported(&(yylsp[(1) - (6)]), yyscanner, "ALTER statements");
+    NotSupported(&(yylsp[-5]), yyscanner, "ALTER statements");
     YYERROR;
   }
+#line 2918 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 20:
-/* Line 1787 of yacc.c  */
-#line 542 "../SqlParser.ypp"
+#line 568 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.create_table_statement_) = new quickstep::ParseStatementCreateTable((yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column, (yyvsp[(3) - (7)].string_value_), (yyvsp[(5) - (7)].attribute_definition_list_));
+    delete (yyvsp[-3].string_value_);
+    delete (yyvsp[0].string_value_);
+    (yyval.statement_) = nullptr;
+    NotSupported(&(yylsp[-5]), yyscanner, "ALTER statements");
+    YYERROR;
   }
+#line 2930 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 21:
-/* Line 1787 of yacc.c  */
-#line 547 "../SqlParser.ypp"
+#line 577 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.drop_table_statement_) = new quickstep::ParseStatementDropTable((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(3) - (3)].string_value_));
+    (yyval.create_table_statement_) = new quickstep::ParseStatementCreateTable((yylsp[-6]).first_line, (yylsp[-6]).first_column, (yyvsp[-4].string_value_), (yyvsp[-2].attribute_definition_list_));
   }
+#line 2938 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 22:
-/* Line 1787 of yacc.c  */
-#line 552 "../SqlParser.ypp"
+#line 582 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.attribute_definition_) = new quickstep::ParseAttributeDefinition((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(1) - (3)].string_value_), (yyvsp[(2) - (3)].data_type_), (yyvsp[(3) - (3)].column_constraint_list_));
+    delete (yyvsp[-6].string_value_);
+    delete (yyvsp[-4].string_value_);
+    delete (yyvsp[-3].string_list_);
+    delete (yyvsp[-1].string_value_);
+    delete (yyvsp[0].key_value_list_);
+    (yyval.statement_) = nullptr;
+    NotSupported(&(yylsp[-8]), yyscanner, "CREATE INDEX statement");
+    YYERROR;
   }
+#line 2953 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 23:
-/* Line 1787 of yacc.c  */
-#line 557 "../SqlParser.ypp"
+#line 594 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.attribute_definition_list_) = new quickstep::PtrList<quickstep::ParseAttributeDefinition>();
-    (yyval.attribute_definition_list_)->push_back((yyvsp[(1) - (1)].attribute_definition_));
+    (yyval.drop_table_statement_) = new quickstep::ParseStatementDropTable((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[0].string_value_));
   }
+#line 2961 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 24:
-/* Line 1787 of yacc.c  */
-#line 561 "../SqlParser.ypp"
+#line 599 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.attribute_definition_list_) = (yyvsp[(1) - (3)].attribute_definition_list_);
-    (yyval.attribute_definition_list_)->push_back((yyvsp[(3) - (3)].attribute_definition_));
+    (yyval.attribute_definition_) = new quickstep::ParseAttributeDefinition((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[-2].string_value_), (yyvsp[-1].data_type_), (yyvsp[0].column_constraint_list_));
   }
+#line 2969 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 25:
-/* Line 1787 of yacc.c  */
-#line 567 "../SqlParser.ypp"
+#line 604 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = nullptr;
-    NotSupported(&(yylsp[(1) - (1)]), yyscanner, "BIT data type");
-    YYERROR;
+    (yyval.attribute_definition_list_) = new quickstep::PtrList<quickstep::ParseAttributeDefinition>();
+    (yyval.attribute_definition_list_)->push_back((yyvsp[0].attribute_definition_));
   }
+#line 2978 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 26:
-/* Line 1787 of yacc.c  */
-#line 572 "../SqlParser.ypp"
+#line 608 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDatetime));
+    (yyval.attribute_definition_list_) = (yyvsp[-2].attribute_definition_list_);
+    (yyval.attribute_definition_list_)->push_back((yyvsp[0].attribute_definition_));
   }
+#line 2987 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 27:
-/* Line 1787 of yacc.c  */
-#line 575 "../SqlParser.ypp"
+#line 614 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDatetime));
+    (yyval.data_type_) = nullptr;
+    NotSupported(&(yylsp[0]), yyscanner, "BIT data type");
+    YYERROR;
   }
+#line 2997 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 28:
-/* Line 1787 of yacc.c  */
-#line 578 "../SqlParser.ypp"
-    {
-    (yyval.data_type_) = nullptr;
-    NotSupported(&(yylsp[(1) - (1)]), yyscanner, "TIME data type");
-    YYERROR;
-  }
-    break;
-
-  case 29:
-/* Line 1787 of yacc.c  */
-#line 583 "../SqlParser.ypp"
+#line 619 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDatetime));
   }
+#line 3005 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 29:
+#line 622 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDatetime));
+  }
+#line 3013 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 30:
-/* Line 1787 of yacc.c  */
-#line 586 "../SqlParser.ypp"
+#line 625 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDouble));
+    (yyval.data_type_) = nullptr;
+    NotSupported(&(yylsp[0]), yyscanner, "TIME data type");
+    YYERROR;
   }
+#line 3023 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 31:
-/* Line 1787 of yacc.c  */
-#line 589 "../SqlParser.ypp"
+#line 630 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDouble));
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDatetime));
   }
+#line 3031 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 32:
-/* Line 1787 of yacc.c  */
-#line 592 "../SqlParser.ypp"
+#line 633 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDouble));
   }
+#line 3039 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 33:
-/* Line 1787 of yacc.c  */
-#line 595 "../SqlParser.ypp"
+#line 636 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kFloat));
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDouble));
   }
+#line 3047 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 34:
-/* Line 1787 of yacc.c  */
-#line 598 "../SqlParser.ypp"
+#line 639 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kInt));
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDouble));
   }
+#line 3055 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 35:
-/* Line 1787 of yacc.c  */
-#line 601 "../SqlParser.ypp"
+#line 642 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kInt));
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kFloat));
   }
+#line 3063 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 36:
-/* Line 1787 of yacc.c  */
-#line 604 "../SqlParser.ypp"
+#line 645 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kLong));
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kInt));
   }
+#line 3071 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 37:
-/* Line 1787 of yacc.c  */
-#line 607 "../SqlParser.ypp"
+#line 648 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kLong));
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kInt));
   }
+#line 3079 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 38:
-/* Line 1787 of yacc.c  */
-#line 610 "../SqlParser.ypp"
+#line 651 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kLong));
+  }
+#line 3087 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 39:
+#line 654 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kLong));
+  }
+#line 3095 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 40:
+#line 657 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     /**
      * NOTE(chasseur): This pattern exhibits a shift/reduce conflict with the
@@ -3227,1193 +3103,1314 @@
      * than reduce, so the case in 'literal_value' has precedence over this.
      **/
     (yyval.data_type_) = nullptr;
-    quickstep_yyerror(&(yylsp[(1) - (1)]), yyscanner, nullptr,
+    quickstep_yyerror(&(yylsp[0]), yyscanner, nullptr,
         "INTERVAL is ambiguous as a column type. Specify either DATETIME INTERVAL "
         "or YEARMONTH INTERVAL");
     YYERROR;
   }
-    break;
-
-  case 39:
-/* Line 1787 of yacc.c  */
-#line 622 "../SqlParser.ypp"
-    {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDatetimeInterval));
-  }
-    break;
-
-  case 40:
-/* Line 1787 of yacc.c  */
-#line 625 "../SqlParser.ypp"
-    {
-    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kYearMonthInterval));
-  }
+#line 3112 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 41:
-/* Line 1787 of yacc.c  */
-#line 628 "../SqlParser.ypp"
+#line 669 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    if ((yyvsp[(3) - (4)].numeric_literal_value_)->float_like()) {
-      delete (yyvsp[(3) - (4)].numeric_literal_value_);
-      (yyval.data_type_) = NULL;
-      quickstep_yyerror(&(yylsp[(3) - (4)]), yyscanner, nullptr, "Non-integer length supplied for CHAR type");
-      YYERROR;
-    } else {
-      if ((yyvsp[(3) - (4)].numeric_literal_value_)->long_value() <= 0) {
-        delete (yyvsp[(3) - (4)].numeric_literal_value_);
-        (yyval.data_type_) = NULL;
-        quickstep_yyerror(&(yylsp[(3) - (4)]), yyscanner, nullptr, "Length for CHAR type must be at least 1");
-        YYERROR;
-      } else {
-        (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kChar, (yyvsp[(3) - (4)].numeric_literal_value_)->long_value(), false));
-        delete (yyvsp[(3) - (4)].numeric_literal_value_);
-      }
-    }
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kDatetimeInterval));
   }
+#line 3120 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 42:
-/* Line 1787 of yacc.c  */
-#line 646 "../SqlParser.ypp"
+#line 672 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    if ((yyvsp[(3) - (4)].numeric_literal_value_)->float_like()) {
-      delete (yyvsp[(3) - (4)].numeric_literal_value_);
-      (yyval.data_type_) = NULL;
-      quickstep_yyerror(&(yylsp[(3) - (4)]), yyscanner, nullptr, "Non-integer length supplied for VARCHAR type");
-      YYERROR;
-    } else {
-      if ((yyvsp[(3) - (4)].numeric_literal_value_)->long_value() < 0) {
-        delete (yyvsp[(3) - (4)].numeric_literal_value_);
-        (yyval.data_type_) = NULL;
-        quickstep_yyerror(&(yylsp[(3) - (4)]), yyscanner, nullptr, "Negative length supplied for VARCHAR type");
-        YYERROR;
-      } else {
-        (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kVarChar, (yyvsp[(3) - (4)].numeric_literal_value_)->long_value(), false));
-        delete (yyvsp[(3) - (4)].numeric_literal_value_);
-      }
-    }
+    (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kYearMonthInterval));
   }
+#line 3128 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 43:
-/* Line 1787 of yacc.c  */
-#line 666 "../SqlParser.ypp"
+#line 675 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.column_constraint_) = new quickstep::ParseColumnConstraintNull((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column);
-  }
-    break;
-
-  case 44:
-/* Line 1787 of yacc.c  */
-#line 669 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_) = new quickstep::ParseColumnConstraintNotNull((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column);
-  }
-    break;
-
-  case 45:
-/* Line 1787 of yacc.c  */
-#line 672 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_) = nullptr;
-    NotSupported(&(yylsp[(1) - (1)]), yyscanner, "Column Constraints (UNIQUE)");
-    YYERROR;
-  }
-    break;
-
-  case 46:
-/* Line 1787 of yacc.c  */
-#line 677 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_) = nullptr;
-    NotSupported(&(yylsp[(1) - (2)]), yyscanner, "Column Constraints (PRIMARY KEY)");
-    YYERROR;
-  }
-    break;
-
-  case 47:
-/* Line 1787 of yacc.c  */
-#line 682 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_) = nullptr;
-    delete (yyvsp[(2) - (2)].literal_value_);
-    NotSupported(&(yylsp[(1) - (2)]), yyscanner, "Column Constraints (DEFAULT)");
-    YYERROR;
-  }
-    break;
-
-  case 48:
-/* Line 1787 of yacc.c  */
-#line 688 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_) = nullptr;
-    delete (yyvsp[(3) - (4)].predicate_);
-    NotSupported(&(yylsp[(1) - (4)]), yyscanner, "Column Constraints (CHECK)");
-    YYERROR;
-  }
-    break;
-
-  case 49:
-/* Line 1787 of yacc.c  */
-#line 694 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_) = nullptr;
-    delete (yyvsp[(2) - (5)].string_value_);
-    delete (yyvsp[(4) - (5)].string_value_);
-    NotSupported(&(yylsp[(1) - (5)]), yyscanner, "Foreign Keys");
-    YYERROR;
-  }
-    break;
-
-  case 50:
-/* Line 1787 of yacc.c  */
-#line 703 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_list_) = (yyvsp[(1) - (2)].column_constraint_list_);
-    (yyval.column_constraint_list_)->push_back((yyvsp[(2) - (2)].column_constraint_));
-  }
-    break;
-
-  case 51:
-/* Line 1787 of yacc.c  */
-#line 707 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_list_) = new quickstep::PtrList<quickstep::ParseColumnConstraint>();
-    (yyval.column_constraint_list_)->push_back((yyvsp[(1) - (1)].column_constraint_));
-  }
-    break;
-
-  case 52:
-/* Line 1787 of yacc.c  */
-#line 713 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_list_) = nullptr;
-  }
-    break;
-
-  case 53:
-/* Line 1787 of yacc.c  */
-#line 716 "../SqlParser.ypp"
-    {
-    (yyval.column_constraint_list_) = (yyvsp[(1) - (1)].column_constraint_list_);
-  }
-    break;
-
-  case 54:
-/* Line 1787 of yacc.c  */
-#line 721 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(3) - (4)].string_list_);
-    NotSupported(&(yylsp[(1) - (4)]), yyscanner, "Table Constraints (UNIQUE)");
-    YYERROR;
-  }
-    break;
-
-  case 55:
-/* Line 1787 of yacc.c  */
-#line 726 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(4) - (5)].string_list_);
-    NotSupported(&(yylsp[(1) - (5)]), yyscanner, "Table Constraints (PRIMARY KEY)");
-    YYERROR;
-  }
-    break;
-
-  case 56:
-/* Line 1787 of yacc.c  */
-#line 731 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(4) - (10)].string_list_);
-    delete (yyvsp[(7) - (10)].string_value_);
-    delete (yyvsp[(9) - (10)].string_list_);
-    NotSupported(&(yylsp[(1) - (10)]), yyscanner, "Table Constraints (FOREIGN KEY)");
-    YYERROR;
-  }
-    break;
-
-  case 57:
-/* Line 1787 of yacc.c  */
-#line 738 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(3) - (4)].predicate_);
-    NotSupported(&(yylsp[(1) - (4)]), yyscanner, "Table Constraints (CHECK)");
-    YYERROR;
-  }
-    break;
-
-  case 58:
-/* Line 1787 of yacc.c  */
-#line 745 "../SqlParser.ypp"
-    {
-    NotSupported(&(yylsp[(1) - (3)]), yyscanner, "Table Constraints");
-    YYERROR;
-  }
-    break;
-
-  case 59:
-/* Line 1787 of yacc.c  */
-#line 749 "../SqlParser.ypp"
-    {
-    NotSupported(&(yylsp[(1) - (1)]), yyscanner, "Table Constraints");
-    YYERROR;
-  }
-    break;
-
-  case 60:
-/* Line 1787 of yacc.c  */
-#line 755 "../SqlParser.ypp"
-    {
-    /* $$ = nullptr; */
-  }
-    break;
-
-  case 61:
-/* Line 1787 of yacc.c  */
-#line 758 "../SqlParser.ypp"
-    {
-    /* $$ = $1; */
-  }
-    break;
-
-  case 62:
-/* Line 1787 of yacc.c  */
-#line 764 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(3) - (10)].string_value_);
-    delete (yyvsp[(5) - (10)].string_list_);
-    delete (yyvsp[(9) - (10)].literal_value_list_);
-    (yyval.insert_statement_) = nullptr;
-    NotSupported(&(yylsp[(4) - (10)]), yyscanner, "list of column names in INSERT statement");
-    YYERROR;
-  }
-    break;
-
-  case 63:
-/* Line 1787 of yacc.c  */
-#line 772 "../SqlParser.ypp"
-    {
-    (yyval.insert_statement_) = new quickstep::ParseStatementInsert((yylsp[(1) - (7)]).first_line, (yylsp[(1) - (7)]).first_column, (yyvsp[(3) - (7)].string_value_), (yyvsp[(6) - (7)].literal_value_list_));
-  }
-    break;
-
-  case 64:
-/* Line 1787 of yacc.c  */
-#line 777 "../SqlParser.ypp"
-    {
-    (yyval.copy_from_statement_) = new quickstep::ParseStatementCopyFrom((yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column, (yyvsp[(2) - (5)].string_value_), (yyvsp[(4) - (5)].string_value_), (yyvsp[(5) - (5)].copy_from_params_));
-  }
-    break;
-
-  case 65:
-/* Line 1787 of yacc.c  */
-#line 782 "../SqlParser.ypp"
-    {
-    (yyval.copy_from_params_) = nullptr;
-  }
-    break;
-
-  case 66:
-/* Line 1787 of yacc.c  */
-#line 785 "../SqlParser.ypp"
-    {
-    (yyval.copy_from_params_) = (yyvsp[(3) - (4)].copy_from_params_);
-  }
-    break;
-
-  case 67:
-/* Line 1787 of yacc.c  */
-#line 790 "../SqlParser.ypp"
-    {
-    (yyval.copy_from_params_) = new quickstep::ParseCopyFromParams((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column);
-    (yyval.copy_from_params_)->set_delimiter((yyvsp[(2) - (2)].string_value_));
-  }
-    break;
-
-  case 68:
-/* Line 1787 of yacc.c  */
-#line 794 "../SqlParser.ypp"
-    {
-    (yyval.copy_from_params_) = new quickstep::ParseCopyFromParams((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column);
-    (yyval.copy_from_params_)->escape_strings = (yyvsp[(2) - (2)].boolean_value_);
-  }
-    break;
-
-  case 69:
-/* Line 1787 of yacc.c  */
-#line 798 "../SqlParser.ypp"
-    {
-    (yyval.copy_from_params_) = (yyvsp[(1) - (4)].copy_from_params_);
-    (yyval.copy_from_params_)->set_delimiter((yyvsp[(4) - (4)].string_value_));
-  }
-    break;
-
-  case 70:
-/* Line 1787 of yacc.c  */
-#line 802 "../SqlParser.ypp"
-    {
-    (yyval.copy_from_params_) = (yyvsp[(1) - (4)].copy_from_params_);
-    (yyval.copy_from_params_)->escape_strings = (yyvsp[(4) - (4)].boolean_value_);
-  }
-    break;
-
-  case 71:
-/* Line 1787 of yacc.c  */
-#line 808 "../SqlParser.ypp"
-    {
-    (yyval.update_statement_) = new quickstep::ParseStatementUpdate((yylsp[(1) - (5)]).first_line, (yylsp[(1) - (5)]).first_column, (yyvsp[(2) - (5)].string_value_), (yyvsp[(4) - (5)].assignment_list_), (yyvsp[(5) - (5)].predicate_));
-  }
-    break;
-
-  case 72:
-/* Line 1787 of yacc.c  */
-#line 813 "../SqlParser.ypp"
-    {
-    (yyval.delete_statement_) = new quickstep::ParseStatementDelete((yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column, (yyvsp[(3) - (4)].string_value_), (yyvsp[(4) - (4)].predicate_));
-  }
-    break;
-
-  case 73:
-/* Line 1787 of yacc.c  */
-#line 818 "../SqlParser.ypp"
-    {
-    (yyval.assignment_list_) = (yyvsp[(1) - (3)].assignment_list_);
-    (yyval.assignment_list_)->push_back((yyvsp[(3) - (3)].assignment_));
-  }
-    break;
-
-  case 74:
-/* Line 1787 of yacc.c  */
-#line 822 "../SqlParser.ypp"
-    {
-    (yyval.assignment_list_) = new quickstep::PtrList<quickstep::ParseAssignment>();
-    (yyval.assignment_list_)->push_back((yyvsp[(1) - (1)].assignment_));
-  }
-    break;
-
-  case 75:
-/* Line 1787 of yacc.c  */
-#line 828 "../SqlParser.ypp"
-    {
-    (yyval.assignment_) = new quickstep::ParseAssignment((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(1) - (3)].string_value_), (yyvsp[(3) - (3)].expression_));
-  }
-    break;
-
-  case 76:
-/* Line 1787 of yacc.c  */
-#line 834 "../SqlParser.ypp"
-    {
-    (yyval.select_statement_) = new quickstep::ParseStatementSelect((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, (yyvsp[(2) - (2)].select_query_), (yyvsp[(1) - (2)].with_list_));
-  }
-    break;
-
-  case 77:
-/* Line 1787 of yacc.c  */
-#line 839 "../SqlParser.ypp"
-    {
-    (yyval.with_list_) = nullptr;
-  }
-    break;
-
-  case 78:
-/* Line 1787 of yacc.c  */
-#line 842 "../SqlParser.ypp"
-    {
-    (yyval.with_list_) = (yyvsp[(2) - (2)].with_list_);
-  }
-    break;
-
-  case 79:
-/* Line 1787 of yacc.c  */
-#line 847 "../SqlParser.ypp"
-    {
-    (yyval.with_list_) = new quickstep::PtrVector<quickstep::ParseSubqueryTableReference>();
-    (yyval.with_list_)->push_back((yyvsp[(1) - (1)].with_list_element_));
-  }
-    break;
-
-  case 80:
-/* Line 1787 of yacc.c  */
-#line 851 "../SqlParser.ypp"
-    {
-    (yyval.with_list_) = (yyvsp[(1) - (3)].with_list_);
-    (yyval.with_list_)->push_back((yyvsp[(3) - (3)].with_list_element_));
-  }
-    break;
-
-  case 81:
-/* Line 1787 of yacc.c  */
-#line 857 "../SqlParser.ypp"
-    {
-    (yyval.with_list_element_) = new quickstep::ParseSubqueryTableReference((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(3) - (3)].subquery_expression_));
-    (yyval.with_list_element_)->set_table_reference_signature((yyvsp[(1) - (3)].table_reference_signature_));
-  }
-    break;
-
-  case 82:
-/* Line 1787 of yacc.c  */
-#line 864 "../SqlParser.ypp"
-    {
-    (yyval.select_query_) = new quickstep::ParseSelect((yylsp[(1) - (9)]).first_line, (yylsp[(1) - (9)]).first_column, (yyvsp[(3) - (9)].selection_), (yyvsp[(4) - (9)].table_reference_list_), (yyvsp[(5) - (9)].predicate_), (yyvsp[(6) - (9)].opt_group_by_clause_), (yyvsp[(7) - (9)].opt_having_clause_), (yyvsp[(8) - (9)].opt_order_by_clause_), (yyvsp[(9) - (9)].opt_limit_clause_));
-  }
-    break;
-
-  case 83:
-/* Line 1787 of yacc.c  */
-#line 869 "../SqlParser.ypp"
-    {
-    /* $$ = nullptr; */
-  }
-    break;
-
-  case 84:
-/* Line 1787 of yacc.c  */
-#line 872 "../SqlParser.ypp"
-    {
-    NotSupported(&(yylsp[(1) - (1)]), yyscanner, "ALL in selection");
-    YYERROR;
-  }
-    break;
-
-  case 85:
-/* Line 1787 of yacc.c  */
-#line 876 "../SqlParser.ypp"
-    {
-    NotSupported(&(yylsp[(1) - (1)]), yyscanner, "DISTINCT in selection");
-    YYERROR;
-  }
-    break;
-
-  case 86:
-/* Line 1787 of yacc.c  */
-#line 882 "../SqlParser.ypp"
-    {
-    (yyval.selection_) = new quickstep::ParseSelectionStar((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column);
-  }
-    break;
-
-  case 87:
-/* Line 1787 of yacc.c  */
-#line 885 "../SqlParser.ypp"
-    {
-    (yyval.selection_) = (yyvsp[(1) - (1)].selection_list_);
-  }
-    break;
-
-  case 88:
-/* Line 1787 of yacc.c  */
-#line 890 "../SqlParser.ypp"
-    {
-    (yyval.selection_list_) = new quickstep::ParseSelectionList((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column);
-    (yyval.selection_list_)->add((yyvsp[(1) - (1)].selection_item_));
-  }
-    break;
-
-  case 89:
-/* Line 1787 of yacc.c  */
-#line 894 "../SqlParser.ypp"
-    {
-    (yyval.selection_list_) = (yyvsp[(1) - (3)].selection_list_);
-    (yyval.selection_list_)->add((yyvsp[(3) - (3)].selection_item_));
-  }
-    break;
-
-  case 90:
-/* Line 1787 of yacc.c  */
-#line 900 "../SqlParser.ypp"
-    {
-    (yyval.selection_item_) = new quickstep::ParseSelectionItem((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(1) - (3)].expression_), (yyvsp[(3) - (3)].string_value_));
-  }
-    break;
-
-  case 91:
-/* Line 1787 of yacc.c  */
-#line 903 "../SqlParser.ypp"
-    {
-    (yyval.selection_item_) = new quickstep::ParseSelectionItem((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, (yyvsp[(1) - (2)].expression_), (yyvsp[(2) - (2)].string_value_));
-  }
-    break;
-
-  case 92:
-/* Line 1787 of yacc.c  */
-#line 906 "../SqlParser.ypp"
-    {
-    (yyval.selection_item_) = new quickstep::ParseSelectionItem((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column, (yyvsp[(1) - (1)].expression_));
-  }
-    break;
-
-  case 93:
-/* Line 1787 of yacc.c  */
-#line 911 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_list_) = (yyvsp[(2) - (3)].table_reference_list_);
-  }
-    break;
-
-  case 94:
-/* Line 1787 of yacc.c  */
-#line 916 "../SqlParser.ypp"
-    {
-    /* $$ = nullptr; */
-  }
-    break;
-
-  case 95:
-/* Line 1787 of yacc.c  */
-#line 919 "../SqlParser.ypp"
-    {
-    NotSupported(&(yylsp[(1) - (1)]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
-    YYERROR;
-  }
-    break;
-
-  case 96:
-/* Line 1787 of yacc.c  */
-#line 925 "../SqlParser.ypp"
-    {
-    NotSupported(&(yylsp[(1) - (2)]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
-    YYERROR;
-  }
-    break;
-
-  case 97:
-/* Line 1787 of yacc.c  */
-#line 929 "../SqlParser.ypp"
-    {
-    NotSupported(&(yylsp[(1) - (1)]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
-    YYERROR;
-  }
-    break;
-
-  case 98:
-/* Line 1787 of yacc.c  */
-#line 935 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(3) - (5)].string_list_);
-    delete (yyvsp[(5) - (5)].predicate_);
-    NotSupported(&(yylsp[(1) - (5)]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
-    YYERROR;
-  }
-    break;
-
-  case 99:
-/* Line 1787 of yacc.c  */
-#line 941 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(2) - (4)].string_list_);
-    delete (yyvsp[(4) - (4)].predicate_);
-    NotSupported(&(yylsp[(1) - (4)]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
-    YYERROR;
-  }
-    break;
-
-  case 100:
-/* Line 1787 of yacc.c  */
-#line 947 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(4) - (6)].string_list_);
-    delete (yyvsp[(6) - (6)].predicate_);
-    NotSupported(&(yylsp[(1) - (6)]), yyscanner, "OUTER JOIN");
-    YYERROR;
-  }
-    break;
-
-  case 101:
-/* Line 1787 of yacc.c  */
-#line 953 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(3) - (5)].string_list_);
-    delete (yyvsp[(5) - (5)].predicate_);
-    NotSupported(&(yylsp[(1) - (5)]), yyscanner, "OUTER JOIN");
-    YYERROR;
-  }
-    break;
-
-  case 102:
-/* Line 1787 of yacc.c  */
-#line 959 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(4) - (6)].string_list_);
-    delete (yyvsp[(6) - (6)].predicate_);
-    NotSupported(&(yylsp[(1) - (6)]), yyscanner, "OUTER JOIN");
-    YYERROR;
-  }
-    break;
-
-  case 103:
-/* Line 1787 of yacc.c  */
-#line 965 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(3) - (5)].string_list_);
-    delete (yyvsp[(5) - (5)].predicate_);
-    NotSupported(&(yylsp[(1) - (5)]), yyscanner, "OUTER JOIN");
-    YYERROR;
-  }
-    break;
-
-  case 104:
-/* Line 1787 of yacc.c  */
-#line 971 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(4) - (6)].string_list_);
-    delete (yyvsp[(6) - (6)].predicate_);
-    NotSupported(&(yylsp[(1) - (6)]), yyscanner, "OUTER JOIN");
-    YYERROR;
-  }
-    break;
-
-  case 105:
-/* Line 1787 of yacc.c  */
-#line 977 "../SqlParser.ypp"
-    {
-    delete (yyvsp[(3) - (5)].string_list_);
-    delete (yyvsp[(5) - (5)].predicate_);
-    NotSupported(&(yylsp[(1) - (5)]), yyscanner, "OUTER JOIN");
-    YYERROR;
-  }
-    break;
-
-  case 106:
-/* Line 1787 of yacc.c  */
-#line 985 "../SqlParser.ypp"
-    {
-    (yyval.subquery_expression_) = new quickstep::ParseSubqueryExpression((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(2) - (3)].select_query_));
-  }
-    break;
-
-  case 107:
-/* Line 1787 of yacc.c  */
-#line 990 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_) = new quickstep::ParseSubqueryTableReference((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, (yyvsp[(1) - (2)].subquery_expression_));
-    (yyval.table_reference_)->set_table_reference_signature((yyvsp[(2) - (2)].table_reference_signature_));
-  }
-    break;
-
-  case 108:
-/* Line 1787 of yacc.c  */
-#line 994 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_) = new quickstep::ParseSimpleTableReference((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, (yyvsp[(1) - (2)].string_value_));
-    (yyval.table_reference_)->set_table_reference_signature((yyvsp[(2) - (2)].table_reference_signature_));
-  }
-    break;
-
-  case 109:
-/* Line 1787 of yacc.c  */
-#line 998 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_) = new quickstep::ParseSimpleTableReference((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column, (yyvsp[(1) - (1)].string_value_));
-  }
-    break;
-
-  case 110:
-/* Line 1787 of yacc.c  */
-#line 1003 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_signature_) = (yyvsp[(1) - (1)].table_reference_signature_);
-  }
-    break;
-
-  case 111:
-/* Line 1787 of yacc.c  */
-#line 1006 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_signature_) = (yyvsp[(2) - (2)].table_reference_signature_);
-  }
-    break;
-
-  case 112:
-/* Line 1787 of yacc.c  */
-#line 1011 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_signature_) = new ::quickstep::ParseTableReferenceSignature((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column, (yyvsp[(1) - (1)].string_value_));
-  }
-    break;
-
-  case 113:
-/* Line 1787 of yacc.c  */
-#line 1014 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_signature_) = new ::quickstep::ParseTableReferenceSignature((yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column, (yyvsp[(1) - (4)].string_value_), (yyvsp[(3) - (4)].string_list_));
-  }
-    break;
-
-  case 114:
-/* Line 1787 of yacc.c  */
-#line 1019 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_list_) = new quickstep::PtrList<quickstep::ParseTableReference>();
-    (yyval.table_reference_list_)->push_back((yyvsp[(1) - (1)].table_reference_));
-  }
-    break;
-
-  case 115:
-/* Line 1787 of yacc.c  */
-#line 1023 "../SqlParser.ypp"
-    {
-    (yyval.table_reference_list_) = (yyvsp[(1) - (3)].table_reference_list_);
-    (yyval.table_reference_list_)->push_back((yyvsp[(3) - (3)].table_reference_));
-  }
-    break;
-
-  case 116:
-/* Line 1787 of yacc.c  */
-#line 1029 "../SqlParser.ypp"
-    {
-    (yyval.opt_group_by_clause_) = nullptr;
-  }
-    break;
-
-  case 117:
-/* Line 1787 of yacc.c  */
-#line 1032 "../SqlParser.ypp"
-    {
-    (yyval.opt_group_by_clause_) = new quickstep::ParseGroupBy((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(3) - (3)].expression_list_));
-  }
-    break;
-
-  case 118:
-/* Line 1787 of yacc.c  */
-#line 1037 "../SqlParser.ypp"
-    {
-    (yyval.opt_having_clause_) = nullptr;
-  }
-    break;
-
-  case 119:
-/* Line 1787 of yacc.c  */
-#line 1040 "../SqlParser.ypp"
-    {
-    (yyval.opt_having_clause_) = new quickstep::ParseHaving((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, (yyvsp[(2) - (2)].predicate_));
-  }
-    break;
-
-  case 120:
-/* Line 1787 of yacc.c  */
-#line 1045 "../SqlParser.ypp"
-    {
-    (yyval.opt_order_by_clause_) = nullptr;
-  }
-    break;
-
-  case 121:
-/* Line 1787 of yacc.c  */
-#line 1048 "../SqlParser.ypp"
-    {
-    (yyval.opt_order_by_clause_) = new quickstep::ParseOrderBy((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(3) - (3)].order_commalist_));
-  }
-    break;
-
-  case 122:
-/* Line 1787 of yacc.c  */
-#line 1053 "../SqlParser.ypp"
-    {
-    (yyval.opt_limit_clause_) = nullptr;
-  }
-    break;
-
-  case 123:
-/* Line 1787 of yacc.c  */
-#line 1056 "../SqlParser.ypp"
-    {
-    if ((yyvsp[(2) - (2)].numeric_literal_value_)->float_like()) {
-      delete (yyvsp[(2) - (2)].numeric_literal_value_);
-      (yyval.opt_limit_clause_) = nullptr;
-      quickstep_yyerror(&(yylsp[(2) - (2)]), yyscanner, nullptr, "LIMIT value must be an integer");
+    if ((yyvsp[-1].numeric_literal_value_)->float_like()) {
+      delete (yyvsp[-1].numeric_literal_value_);
+      (yyval.data_type_) = NULL;
+      quickstep_yyerror(&(yylsp[-1]), yyscanner, nullptr, "Non-integer length supplied for CHAR type");
       YYERROR;
     } else {
-      if ((yyvsp[(2) - (2)].numeric_literal_value_)->long_value() <= 0) {
-        delete (yyvsp[(2) - (2)].numeric_literal_value_);
-        (yyval.opt_limit_clause_) = nullptr;
-        quickstep_yyerror(&(yylsp[(2) - (2)]), yyscanner, nullptr, "LIMIT value must be positive");
+      if ((yyvsp[-1].numeric_literal_value_)->long_value() <= 0) {
+        delete (yyvsp[-1].numeric_literal_value_);
+        (yyval.data_type_) = NULL;
+        quickstep_yyerror(&(yylsp[-1]), yyscanner, nullptr, "Length for CHAR type must be at least 1");
         YYERROR;
       } else {
-        (yyval.opt_limit_clause_) = new quickstep::ParseLimit((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, (yyvsp[(2) - (2)].numeric_literal_value_));
+        (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kChar, (yyvsp[-1].numeric_literal_value_)->long_value(), false));
+        delete (yyvsp[-1].numeric_literal_value_);
       }
     }
   }
+#line 3151 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 44:
+#line 693 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    if ((yyvsp[-1].numeric_literal_value_)->float_like()) {
+      delete (yyvsp[-1].numeric_literal_value_);
+      (yyval.data_type_) = NULL;
+      quickstep_yyerror(&(yylsp[-1]), yyscanner, nullptr, "Non-integer length supplied for VARCHAR type");
+      YYERROR;
+    } else {
+      if ((yyvsp[-1].numeric_literal_value_)->long_value() < 0) {
+        delete (yyvsp[-1].numeric_literal_value_);
+        (yyval.data_type_) = NULL;
+        quickstep_yyerror(&(yylsp[-1]), yyscanner, nullptr, "Negative length supplied for VARCHAR type");
+        YYERROR;
+      } else {
+        (yyval.data_type_) = new quickstep::ParseDataType(quickstep::TypeFactory::GetType(quickstep::kVarChar, (yyvsp[-1].numeric_literal_value_)->long_value(), false));
+        delete (yyvsp[-1].numeric_literal_value_);
+      }
+    }
+  }
+#line 3174 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 45:
+#line 713 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_) = new quickstep::ParseColumnConstraintNull((yylsp[0]).first_line, (yylsp[0]).first_column);
+  }
+#line 3182 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 46:
+#line 716 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_) = new quickstep::ParseColumnConstraintNotNull((yylsp[-1]).first_line, (yylsp[-1]).first_column);
+  }
+#line 3190 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 47:
+#line 719 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_) = nullptr;
+    NotSupported(&(yylsp[0]), yyscanner, "Column Constraints (UNIQUE)");
+    YYERROR;
+  }
+#line 3200 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 48:
+#line 724 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_) = nullptr;
+    NotSupported(&(yylsp[-1]), yyscanner, "Column Constraints (PRIMARY KEY)");
+    YYERROR;
+  }
+#line 3210 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 49:
+#line 729 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_) = nullptr;
+    delete (yyvsp[0].literal_value_);
+    NotSupported(&(yylsp[-1]), yyscanner, "Column Constraints (DEFAULT)");
+    YYERROR;
+  }
+#line 3221 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 50:
+#line 735 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_) = nullptr;
+    delete (yyvsp[-1].predicate_);
+    NotSupported(&(yylsp[-3]), yyscanner, "Column Constraints (CHECK)");
+    YYERROR;
+  }
+#line 3232 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 51:
+#line 741 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_) = nullptr;
+    delete (yyvsp[-3].string_value_);
+    delete (yyvsp[-1].string_value_);
+    NotSupported(&(yylsp[-4]), yyscanner, "Foreign Keys");
+    YYERROR;
+  }
+#line 3244 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 52:
+#line 750 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_list_) = (yyvsp[-1].column_constraint_list_);
+    (yyval.column_constraint_list_)->push_back((yyvsp[0].column_constraint_));
+  }
+#line 3253 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 53:
+#line 754 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_list_) = new quickstep::PtrList<quickstep::ParseColumnConstraint>();
+    (yyval.column_constraint_list_)->push_back((yyvsp[0].column_constraint_));
+  }
+#line 3262 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 54:
+#line 760 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_list_) = nullptr;
+  }
+#line 3270 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 55:
+#line 763 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.column_constraint_list_) = (yyvsp[0].column_constraint_list_);
+  }
+#line 3278 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 56:
+#line 768 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-1].string_list_);
+    NotSupported(&(yylsp[-3]), yyscanner, "Table Constraints (UNIQUE)");
+    YYERROR;
+  }
+#line 3288 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 57:
+#line 773 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-1].string_list_);
+    NotSupported(&(yylsp[-4]), yyscanner, "Table Constraints (PRIMARY KEY)");
+    YYERROR;
+  }
+#line 3298 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 58:
+#line 778 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-6].string_list_);
+    delete (yyvsp[-3].string_value_);
+    delete (yyvsp[-1].string_list_);
+    NotSupported(&(yylsp[-9]), yyscanner, "Table Constraints (FOREIGN KEY)");
+    YYERROR;
+  }
+#line 3310 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 59:
+#line 785 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-1].predicate_);
+    NotSupported(&(yylsp[-3]), yyscanner, "Table Constraints (CHECK)");
+    YYERROR;
+  }
+#line 3320 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 60:
+#line 792 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    NotSupported(&(yylsp[-2]), yyscanner, "Table Constraints");
+    YYERROR;
+  }
+#line 3329 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 61:
+#line 796 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    NotSupported(&(yylsp[0]), yyscanner, "Table Constraints");
+    YYERROR;
+  }
+#line 3338 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 62:
+#line 802 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    /* $$ = nullptr; */
+  }
+#line 3346 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 63:
+#line 805 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    /* $$ = $1; */
+  }
+#line 3354 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 64:
+#line 810 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.string_list_) = nullptr;
+  }
+#line 3362 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 65:
+#line 813 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-1].string_list_);
+    (yyval.string_list_) = nullptr;
+    NotSupported(&(yylsp[-2]), yyscanner, "list of column names in CREATE INDEX statement");
+    YYERROR;
+  }
+#line 3373 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 66:
+#line 821 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_value_list_) = new quickstep::PtrList<quickstep::ParseKeyValue>();
+    (yyval.key_value_list_)->push_back((yyvsp[0].key_value_));
+  }
+#line 3382 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 67:
+#line 825 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_value_list_) = (yyvsp[-2].key_value_list_);
+    (yyval.key_value_list_)->push_back((yyvsp[0].key_value_));
+  }
+#line 3391 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 68:
+#line 831 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_value_) = (yyvsp[0].key_string_value_);
+  }
+#line 3399 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 69:
+#line 834 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_value_) = (yyvsp[0].key_string_list_);
+  }
+#line 3407 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 70:
+#line 837 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_value_) = (yyvsp[0].key_literal_value_);
+  }
+#line 3415 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 71:
+#line 842 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_string_value_) = new quickstep::ParseKeyStringValue((yylsp[-1]).first_line, (yylsp[-1]).first_column, (yyvsp[-1].string_value_), (yyvsp[0].string_value_));
+  }
+#line 3423 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 72:
+#line 847 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_string_list_) = new quickstep::ParseKeyStringList((yylsp[-3]).first_line, (yylsp[-3]).first_column, (yyvsp[-3].string_value_), (yyvsp[-1].string_list_));
+  }
+#line 3431 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 73:
+#line 852 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_literal_value_) = new quickstep::ParseKeyLiteralValue((yylsp[-1]).first_line, (yylsp[-1]).first_column, (yyvsp[-1].string_value_), (yyvsp[0].literal_value_));
+  }
+#line 3439 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 74:
+#line 857 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.string_value_) = nullptr;
+    NotSupported(&(yylsp[0]), yyscanner, "Bloom Filter Index");
+    YYERROR;
+  }
+#line 3449 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 75:
+#line 862 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.string_value_) = nullptr;
+    NotSupported(&(yylsp[0]), yyscanner, "CSB Tree Index");
+    YYERROR;
+  }
+#line 3459 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 76:
+#line 869 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_value_list_) = nullptr;
+  }
+#line 3467 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 77:
+#line 872 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.key_value_list_) = (yyvsp[-1].key_value_list_);
+  }
+#line 3475 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 78:
+#line 879 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-7].string_value_);
+    delete (yyvsp[-5].string_list_);
+    delete (yyvsp[-1].literal_value_list_);
+    (yyval.insert_statement_) = nullptr;
+    NotSupported(&(yylsp[-6]), yyscanner, "list of column names in INSERT statement");
+    YYERROR;
+  }
+#line 3488 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 79:
+#line 887 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.insert_statement_) = new quickstep::ParseStatementInsert((yylsp[-6]).first_line, (yylsp[-6]).first_column, (yyvsp[-4].string_value_), (yyvsp[-1].literal_value_list_));
+  }
+#line 3496 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 80:
+#line 892 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.copy_from_statement_) = new quickstep::ParseStatementCopyFrom((yylsp[-4]).first_line, (yylsp[-4]).first_column, (yyvsp[-3].string_value_), (yyvsp[-1].string_value_), (yyvsp[0].copy_from_params_));
+  }
+#line 3504 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 81:
+#line 897 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.copy_from_params_) = nullptr;
+  }
+#line 3512 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 82:
+#line 900 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.copy_from_params_) = (yyvsp[-1].copy_from_params_);
+  }
+#line 3520 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 83:
+#line 905 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.copy_from_params_) = new quickstep::ParseCopyFromParams((yylsp[-1]).first_line, (yylsp[-1]).first_column);
+    (yyval.copy_from_params_)->set_delimiter((yyvsp[0].string_value_));
+  }
+#line 3529 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 84:
+#line 909 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.copy_from_params_) = new quickstep::ParseCopyFromParams((yylsp[-1]).first_line, (yylsp[-1]).first_column);
+    (yyval.copy_from_params_)->escape_strings = (yyvsp[0].boolean_value_);
+  }
+#line 3538 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 85:
+#line 913 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.copy_from_params_) = (yyvsp[-3].copy_from_params_);
+    (yyval.copy_from_params_)->set_delimiter((yyvsp[0].string_value_));
+  }
+#line 3547 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 86:
+#line 917 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.copy_from_params_) = (yyvsp[-3].copy_from_params_);
+    (yyval.copy_from_params_)->escape_strings = (yyvsp[0].boolean_value_);
+  }
+#line 3556 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 87:
+#line 923 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.update_statement_) = new quickstep::ParseStatementUpdate((yylsp[-4]).first_line, (yylsp[-4]).first_column, (yyvsp[-3].string_value_), (yyvsp[-1].assignment_list_), (yyvsp[0].predicate_));
+  }
+#line 3564 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 88:
+#line 928 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.delete_statement_) = new quickstep::ParseStatementDelete((yylsp[-3]).first_line, (yylsp[-3]).first_column, (yyvsp[-1].string_value_), (yyvsp[0].predicate_));
+  }
+#line 3572 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 89:
+#line 933 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.assignment_list_) = (yyvsp[-2].assignment_list_);
+    (yyval.assignment_list_)->push_back((yyvsp[0].assignment_));
+  }
+#line 3581 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 90:
+#line 937 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.assignment_list_) = new quickstep::PtrList<quickstep::ParseAssignment>();
+    (yyval.assignment_list_)->push_back((yyvsp[0].assignment_));
+  }
+#line 3590 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 91:
+#line 943 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.assignment_) = new quickstep::ParseAssignment((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[-2].string_value_), (yyvsp[0].expression_));
+  }
+#line 3598 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 92:
+#line 949 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.select_statement_) = new quickstep::ParseStatementSelect((yylsp[-1]).first_line, (yylsp[-1]).first_column, (yyvsp[0].select_query_), (yyvsp[-1].with_list_));
+  }
+#line 3606 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 93:
+#line 954 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.with_list_) = nullptr;
+  }
+#line 3614 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 94:
+#line 957 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.with_list_) = (yyvsp[0].with_list_);
+  }
+#line 3622 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 95:
+#line 962 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.with_list_) = new quickstep::PtrVector<quickstep::ParseSubqueryTableReference>();
+    (yyval.with_list_)->push_back((yyvsp[0].with_list_element_));
+  }
+#line 3631 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 96:
+#line 966 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.with_list_) = (yyvsp[-2].with_list_);
+    (yyval.with_list_)->push_back((yyvsp[0].with_list_element_));
+  }
+#line 3640 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 97:
+#line 972 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.with_list_element_) = new quickstep::ParseSubqueryTableReference((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[0].subquery_expression_));
+    (yyval.with_list_element_)->set_table_reference_signature((yyvsp[-2].table_reference_signature_));
+  }
+#line 3649 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 98:
+#line 979 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.select_query_) = new quickstep::ParseSelect((yylsp[-8]).first_line, (yylsp[-8]).first_column, (yyvsp[-6].selection_), (yyvsp[-5].table_reference_list_), (yyvsp[-4].predicate_), (yyvsp[-3].opt_group_by_clause_), (yyvsp[-2].opt_having_clause_), (yyvsp[-1].opt_order_by_clause_), (yyvsp[0].opt_limit_clause_));
+  }
+#line 3657 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 99:
+#line 984 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    /* $$ = nullptr; */
+  }
+#line 3665 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 100:
+#line 987 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    NotSupported(&(yylsp[0]), yyscanner, "ALL in selection");
+    YYERROR;
+  }
+#line 3674 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 101:
+#line 991 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    NotSupported(&(yylsp[0]), yyscanner, "DISTINCT in selection");
+    YYERROR;
+  }
+#line 3683 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 102:
+#line 997 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.selection_) = new quickstep::ParseSelectionStar((yylsp[0]).first_line, (yylsp[0]).first_column);
+  }
+#line 3691 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 103:
+#line 1000 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.selection_) = (yyvsp[0].selection_list_);
+  }
+#line 3699 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 104:
+#line 1005 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.selection_list_) = new quickstep::ParseSelectionList((yylsp[0]).first_line, (yylsp[0]).first_column);
+    (yyval.selection_list_)->add((yyvsp[0].selection_item_));
+  }
+#line 3708 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 105:
+#line 1009 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.selection_list_) = (yyvsp[-2].selection_list_);
+    (yyval.selection_list_)->add((yyvsp[0].selection_item_));
+  }
+#line 3717 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 106:
+#line 1015 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.selection_item_) = new quickstep::ParseSelectionItem((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[-2].expression_), (yyvsp[0].string_value_));
+  }
+#line 3725 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 107:
+#line 1018 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.selection_item_) = new quickstep::ParseSelectionItem((yylsp[-1]).first_line, (yylsp[-1]).first_column, (yyvsp[-1].expression_), (yyvsp[0].string_value_));
+  }
+#line 3733 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 108:
+#line 1021 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.selection_item_) = new quickstep::ParseSelectionItem((yylsp[0]).first_line, (yylsp[0]).first_column, (yyvsp[0].expression_));
+  }
+#line 3741 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 109:
+#line 1026 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.table_reference_list_) = (yyvsp[-1].table_reference_list_);
+  }
+#line 3749 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 110:
+#line 1031 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    /* $$ = nullptr; */
+  }
+#line 3757 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 111:
+#line 1034 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    NotSupported(&(yylsp[0]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
+    YYERROR;
+  }
+#line 3766 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 112:
+#line 1040 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    NotSupported(&(yylsp[-1]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
+    YYERROR;
+  }
+#line 3775 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 113:
+#line 1044 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    NotSupported(&(yylsp[0]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
+    YYERROR;
+  }
+#line 3784 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 114:
+#line 1050 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-2].string_list_);
+    delete (yyvsp[0].predicate_);
+    NotSupported(&(yylsp[-4]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
+    YYERROR;
+  }
+#line 3795 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 115:
+#line 1056 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-2].string_list_);
+    delete (yyvsp[0].predicate_);
+    NotSupported(&(yylsp[-3]), yyscanner, "alternate JOIN syntax (specify in WHERE clause instead)");
+    YYERROR;
+  }
+#line 3806 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 116:
+#line 1062 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-2].string_list_);
+    delete (yyvsp[0].predicate_);
+    NotSupported(&(yylsp[-5]), yyscanner, "OUTER JOIN");
+    YYERROR;
+  }
+#line 3817 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 117:
+#line 1068 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-2].string_list_);
+    delete (yyvsp[0].predicate_);
+    NotSupported(&(yylsp[-4]), yyscanner, "OUTER JOIN");
+    YYERROR;
+  }
+#line 3828 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 118:
+#line 1074 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-2].string_list_);
+    delete (yyvsp[0].predicate_);
+    NotSupported(&(yylsp[-5]), yyscanner, "OUTER JOIN");
+    YYERROR;
+  }
+#line 3839 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 119:
+#line 1080 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-2].string_list_);
+    delete (yyvsp[0].predicate_);
+    NotSupported(&(yylsp[-4]), yyscanner, "OUTER JOIN");
+    YYERROR;
+  }
+#line 3850 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 120:
+#line 1086 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-2].string_list_);
+    delete (yyvsp[0].predicate_);
+    NotSupported(&(yylsp[-5]), yyscanner, "OUTER JOIN");
+    YYERROR;
+  }
+#line 3861 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 121:
+#line 1092 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    delete (yyvsp[-2].string_list_);
+    delete (yyvsp[0].predicate_);
+    NotSupported(&(yylsp[-4]), yyscanner, "OUTER JOIN");
+    YYERROR;
+  }
+#line 3872 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 122:
+#line 1100 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.subquery_expression_) = new quickstep::ParseSubqueryExpression((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[-1].select_query_));
+  }
+#line 3880 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 123:
+#line 1105 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.table_reference_) = new quickstep::ParseSubqueryTableReference((yylsp[-1]).first_line, (yylsp[-1]).first_column, (yyvsp[-1].subquery_expression_));
+    (yyval.table_reference_)->set_table_reference_signature((yyvsp[0].table_reference_signature_));
+  }
+#line 3889 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 124:
-/* Line 1787 of yacc.c  */
-#line 1075 "../SqlParser.ypp"
+#line 1109 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.order_commalist_) = new quickstep::PtrList<quickstep::ParseOrderByItem>();
-    (yyval.order_commalist_)->push_back((yyvsp[(1) - (1)].order_item_));
+    (yyval.table_reference_) = new quickstep::ParseSimpleTableReference((yylsp[-1]).first_line, (yylsp[-1]).first_column, (yyvsp[-1].string_value_));
+    (yyval.table_reference_)->set_table_reference_signature((yyvsp[0].table_reference_signature_));
   }
+#line 3898 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 125:
-/* Line 1787 of yacc.c  */
-#line 1079 "../SqlParser.ypp"
+#line 1113 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.order_commalist_) = (yyvsp[(1) - (3)].order_commalist_);
-    (yyval.order_commalist_)->push_back((yyvsp[(3) - (3)].order_item_));
+    (yyval.table_reference_) = new quickstep::ParseSimpleTableReference((yylsp[0]).first_line, (yylsp[0]).first_column, (yyvsp[0].string_value_));
   }
+#line 3906 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 126:
-/* Line 1787 of yacc.c  */
-#line 1085 "../SqlParser.ypp"
+#line 1118 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.order_item_) = new quickstep::ParseOrderByItem((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(1) - (3)].expression_), (yyvsp[(2) - (3)].order_direction_), (yyvsp[(3) - (3)].order_direction_));
-    delete (yyvsp[(2) - (3)].order_direction_);
-    delete (yyvsp[(3) - (3)].order_direction_);
+    (yyval.table_reference_signature_) = (yyvsp[0].table_reference_signature_);
   }
+#line 3914 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 127:
-/* Line 1787 of yacc.c  */
-#line 1092 "../SqlParser.ypp"
+#line 1121 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.order_direction_) = nullptr;
+    (yyval.table_reference_signature_) = (yyvsp[0].table_reference_signature_);
   }
+#line 3922 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 128:
-/* Line 1787 of yacc.c  */
-#line 1095 "../SqlParser.ypp"
+#line 1126 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.order_direction_) = new bool(true);
+    (yyval.table_reference_signature_) = new ::quickstep::ParseTableReferenceSignature((yylsp[0]).first_line, (yylsp[0]).first_column, (yyvsp[0].string_value_));
   }
+#line 3930 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 129:
-/* Line 1787 of yacc.c  */
-#line 1098 "../SqlParser.ypp"
+#line 1129 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.order_direction_) = new bool(false);
+    (yyval.table_reference_signature_) = new ::quickstep::ParseTableReferenceSignature((yylsp[-3]).first_line, (yylsp[-3]).first_column, (yyvsp[-3].string_value_), (yyvsp[-1].string_list_));
   }
+#line 3938 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 130:
-/* Line 1787 of yacc.c  */
-#line 1103 "../SqlParser.ypp"
+#line 1134 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.order_direction_) = nullptr;
+    (yyval.table_reference_list_) = new quickstep::PtrList<quickstep::ParseTableReference>();
+    (yyval.table_reference_list_)->push_back((yyvsp[0].table_reference_));
   }
+#line 3947 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 131:
-/* Line 1787 of yacc.c  */
-#line 1106 "../SqlParser.ypp"
+#line 1138 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.order_direction_) = new bool(true);
+    (yyval.table_reference_list_) = (yyvsp[-2].table_reference_list_);
+    (yyval.table_reference_list_)->push_back((yyvsp[0].table_reference_));
   }
+#line 3956 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 132:
-/* Line 1787 of yacc.c  */
-#line 1109 "../SqlParser.ypp"
+#line 1144 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.order_direction_) = new bool(false);
+    (yyval.opt_group_by_clause_) = nullptr;
   }
+#line 3964 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 133:
-/* Line 1787 of yacc.c  */
-#line 1115 "../SqlParser.ypp"
+#line 1147 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = nullptr;
+    (yyval.opt_group_by_clause_) = new quickstep::ParseGroupBy((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[0].expression_list_));
   }
+#line 3972 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 134:
-/* Line 1787 of yacc.c  */
-#line 1118 "../SqlParser.ypp"
+#line 1152 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = (yyvsp[(1) - (1)].predicate_);
+    (yyval.opt_having_clause_) = nullptr;
   }
+#line 3980 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 135:
-/* Line 1787 of yacc.c  */
-#line 1123 "../SqlParser.ypp"
+#line 1155 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = (yyvsp[(2) - (2)].predicate_);
+    (yyval.opt_having_clause_) = new quickstep::ParseHaving((yylsp[-1]).first_line, (yylsp[-1]).first_column, (yyvsp[0].predicate_));
   }
+#line 3988 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 136:
-/* Line 1787 of yacc.c  */
-#line 1128 "../SqlParser.ypp"
+#line 1160 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    if ((yyvsp[(1) - (3)].predicate_)->getParsePredicateType() == quickstep::ParsePredicate::kDisjunction) {
-      (yyval.predicate_) = (yyvsp[(1) - (3)].predicate_);
-    } else {
-      (yyval.predicate_) = new quickstep::ParsePredicateDisjunction((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column);
-      static_cast<quickstep::ParsePredicateDisjunction *>((yyval.predicate_))->addPredicate((yyvsp[(1) - (3)].predicate_));
-    }
-    static_cast<quickstep::ParsePredicateDisjunction *>((yyval.predicate_))->addPredicate((yyvsp[(3) - (3)].predicate_));
+    (yyval.opt_order_by_clause_) = nullptr;
   }
+#line 3996 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 137:
-/* Line 1787 of yacc.c  */
-#line 1137 "../SqlParser.ypp"
+#line 1163 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = (yyvsp[(1) - (1)].predicate_);
+    (yyval.opt_order_by_clause_) = new quickstep::ParseOrderBy((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[0].order_commalist_));
   }
+#line 4004 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 138:
-/* Line 1787 of yacc.c  */
-#line 1142 "../SqlParser.ypp"
+#line 1168 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    if ((yyvsp[(1) - (3)].predicate_)->getParsePredicateType() == quickstep::ParsePredicate::kConjunction) {
-      (yyval.predicate_) = (yyvsp[(1) - (3)].predicate_);
-    } else {
-      (yyval.predicate_) = new quickstep::ParsePredicateConjunction((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column);
-      static_cast<quickstep::ParsePredicateConjunction *>((yyval.predicate_))->addPredicate((yyvsp[(1) - (3)].predicate_));
-    }
-    static_cast<quickstep::ParsePredicateConjunction *>((yyval.predicate_))->addPredicate((yyvsp[(3) - (3)].predicate_));
+    (yyval.opt_limit_clause_) = nullptr;
   }
+#line 4012 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 139:
-/* Line 1787 of yacc.c  */
-#line 1151 "../SqlParser.ypp"
+#line 1171 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = (yyvsp[(1) - (1)].predicate_);
+    if ((yyvsp[0].numeric_literal_value_)->float_like()) {
+      delete (yyvsp[0].numeric_literal_value_);
+      (yyval.opt_limit_clause_) = nullptr;
+      quickstep_yyerror(&(yylsp[0]), yyscanner, nullptr, "LIMIT value must be an integer");
+      YYERROR;
+    } else {
+      if ((yyvsp[0].numeric_literal_value_)->long_value() <= 0) {
+        delete (yyvsp[0].numeric_literal_value_);
+        (yyval.opt_limit_clause_) = nullptr;
+        quickstep_yyerror(&(yylsp[0]), yyscanner, nullptr, "LIMIT value must be positive");
+        YYERROR;
+      } else {
+        (yyval.opt_limit_clause_) = new quickstep::ParseLimit((yylsp[-1]).first_line, (yylsp[-1]).first_column, (yyvsp[0].numeric_literal_value_));
+      }
+    }
   }
+#line 4034 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 140:
-/* Line 1787 of yacc.c  */
-#line 1156 "../SqlParser.ypp"
+#line 1190 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = new quickstep::ParsePredicateNegation((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, (yyvsp[(2) - (2)].predicate_));
+    (yyval.order_commalist_) = new quickstep::PtrList<quickstep::ParseOrderByItem>();
+    (yyval.order_commalist_)->push_back((yyvsp[0].order_item_));
   }
+#line 4043 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 141:
-/* Line 1787 of yacc.c  */
-#line 1159 "../SqlParser.ypp"
+#line 1194 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = (yyvsp[(1) - (1)].predicate_);
+    (yyval.order_commalist_) = (yyvsp[-2].order_commalist_);
+    (yyval.order_commalist_)->push_back((yyvsp[0].order_item_));
   }
+#line 4052 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 142:
-/* Line 1787 of yacc.c  */
-#line 1164 "../SqlParser.ypp"
+#line 1200 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = new quickstep::ParsePredicateBetween((yylsp[(2) - (5)]).first_line, (yylsp[(2) - (5)]).first_column, (yyvsp[(1) - (5)].expression_), (yyvsp[(3) - (5)].expression_), (yyvsp[(5) - (5)].expression_));
+    (yyval.order_item_) = new quickstep::ParseOrderByItem((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[-2].expression_), (yyvsp[-1].order_direction_), (yyvsp[0].order_direction_));
+    delete (yyvsp[-1].order_direction_);
+    delete (yyvsp[0].order_direction_);
   }
+#line 4062 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 143:
-/* Line 1787 of yacc.c  */
-#line 1167 "../SqlParser.ypp"
+#line 1207 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = new quickstep::ParsePredicateNegation(
-        (yylsp[(2) - (6)]).first_line, (yylsp[(2) - (6)]).first_column,
-        new quickstep::ParsePredicateBetween((yylsp[(3) - (6)]).first_line, (yylsp[(3) - (6)]).first_column, (yyvsp[(1) - (6)].expression_), (yyvsp[(4) - (6)].expression_), (yyvsp[(6) - (6)].expression_)));
+    (yyval.order_direction_) = nullptr;
   }
+#line 4070 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 144:
-/* Line 1787 of yacc.c  */
-#line 1172 "../SqlParser.ypp"
+#line 1210 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    delete (yyvsp[(1) - (4)].attribute_);
-    (yyval.predicate_) = nullptr;
-    NotSupported(&(yylsp[(2) - (4)]), yyscanner, "NULL comparison predicates");
-    YYERROR;
+    (yyval.order_direction_) = new bool(true);
   }
+#line 4078 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 145:
-/* Line 1787 of yacc.c  */
-#line 1178 "../SqlParser.ypp"
+#line 1213 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    delete (yyvsp[(1) - (3)].attribute_);
-    (yyval.predicate_) = nullptr;
-    NotSupported(&(yylsp[(2) - (3)]), yyscanner, "NULL comparison predicates");
-    YYERROR;
+    (yyval.order_direction_) = new bool(false);
   }
+#line 4086 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 146:
-/* Line 1787 of yacc.c  */
-#line 1184 "../SqlParser.ypp"
+#line 1218 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    delete (yyvsp[(1) - (3)].expression_);
-    delete (yyvsp[(3) - (3)].string_value_);
-    (yyval.predicate_) = nullptr;
-    NotSupported(&(yylsp[(2) - (3)]), yyscanner, "LIKE predicates");
-    YYERROR;
+    (yyval.order_direction_) = nullptr;
   }
+#line 4094 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 147:
-/* Line 1787 of yacc.c  */
-#line 1191 "../SqlParser.ypp"
+#line 1221 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = new quickstep::ParsePredicateComparison((yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column, *(yyvsp[(2) - (3)].comparison_), (yyvsp[(1) - (3)].expression_), (yyvsp[(3) - (3)].expression_));
+    (yyval.order_direction_) = new bool(true);
   }
+#line 4102 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 148:
-/* Line 1787 of yacc.c  */
-#line 1194 "../SqlParser.ypp"
+#line 1224 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.predicate_) = (yyvsp[(2) - (3)].predicate_);
+    (yyval.order_direction_) = new bool(false);
   }
+#line 4110 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 149:
-/* Line 1787 of yacc.c  */
-#line 1201 "../SqlParser.ypp"
+#line 1230 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = new quickstep::ParseBinaryExpression((yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column, *(yyvsp[(2) - (3)].binary_operation_), (yyvsp[(1) - (3)].expression_), (yyvsp[(3) - (3)].expression_));
+    (yyval.predicate_) = nullptr;
   }
+#line 4118 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 150:
-/* Line 1787 of yacc.c  */
-#line 1204 "../SqlParser.ypp"
+#line 1233 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = (yyvsp[(1) - (1)].expression_);
+    (yyval.predicate_) = (yyvsp[0].predicate_);
   }
+#line 4126 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 151:
-/* Line 1787 of yacc.c  */
-#line 1209 "../SqlParser.ypp"
+#line 1238 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = new quickstep::ParseBinaryExpression((yylsp[(2) - (3)]).first_line, (yylsp[(2) - (3)]).first_column, *(yyvsp[(2) - (3)].binary_operation_), (yyvsp[(1) - (3)].expression_), (yyvsp[(3) - (3)].expression_));
+    (yyval.predicate_) = (yyvsp[0].predicate_);
   }
+#line 4134 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 152:
-/* Line 1787 of yacc.c  */
-#line 1212 "../SqlParser.ypp"
+#line 1243 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = (yyvsp[(1) - (1)].expression_);
+    if ((yyvsp[-2].predicate_)->getParsePredicateType() == quickstep::ParsePredicate::kDisjunction) {
+      (yyval.predicate_) = (yyvsp[-2].predicate_);
+    } else {
+      (yyval.predicate_) = new quickstep::ParsePredicateDisjunction((yylsp[-2]).first_line, (yylsp[-2]).first_column);
+      static_cast<quickstep::ParsePredicateDisjunction *>((yyval.predicate_))->addPredicate((yyvsp[-2].predicate_));
+    }
+    static_cast<quickstep::ParsePredicateDisjunction *>((yyval.predicate_))->addPredicate((yyvsp[0].predicate_));
   }
+#line 4148 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 153:
-/* Line 1787 of yacc.c  */
-#line 1217 "../SqlParser.ypp"
+#line 1252 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = new quickstep::ParseUnaryExpression((yylsp[(1) - (2)]).first_line, (yylsp[(1) - (2)]).first_column, *(yyvsp[(1) - (2)].unary_operation_), (yyvsp[(2) - (2)].expression_));
+    (yyval.predicate_) = (yyvsp[0].predicate_);
   }
+#line 4156 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 154:
-/* Line 1787 of yacc.c  */
-#line 1220 "../SqlParser.ypp"
+#line 1257 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = (yyvsp[(1) - (1)].expression_);
+    if ((yyvsp[-2].predicate_)->getParsePredicateType() == quickstep::ParsePredicate::kConjunction) {
+      (yyval.predicate_) = (yyvsp[-2].predicate_);
+    } else {
+      (yyval.predicate_) = new quickstep::ParsePredicateConjunction((yylsp[-2]).first_line, (yylsp[-2]).first_column);
+      static_cast<quickstep::ParsePredicateConjunction *>((yyval.predicate_))->addPredicate((yyvsp[-2].predicate_));
+    }
+    static_cast<quickstep::ParsePredicateConjunction *>((yyval.predicate_))->addPredicate((yyvsp[0].predicate_));
   }
+#line 4170 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 155:
-/* Line 1787 of yacc.c  */
-#line 1225 "../SqlParser.ypp"
+#line 1266 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = (yyvsp[(1) - (1)].attribute_);
+    (yyval.predicate_) = (yyvsp[0].predicate_);
   }
+#line 4178 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 156:
-/* Line 1787 of yacc.c  */
-#line 1228 "../SqlParser.ypp"
+#line 1271 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = new quickstep::ParseScalarLiteral((yyvsp[(1) - (1)].literal_value_));
+    (yyval.predicate_) = new quickstep::ParsePredicateNegation((yylsp[-1]).first_line, (yylsp[-1]).first_column, (yyvsp[0].predicate_));
   }
+#line 4186 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 157:
-/* Line 1787 of yacc.c  */
-#line 1231 "../SqlParser.ypp"
+#line 1274 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = (yyvsp[(1) - (1)].function_call_);
+    (yyval.predicate_) = (yyvsp[0].predicate_);
   }
+#line 4194 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 158:
-/* Line 1787 of yacc.c  */
-#line 1234 "../SqlParser.ypp"
+#line 1279 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_) = (yyvsp[(2) - (3)].expression_);
+    (yyval.predicate_) = new quickstep::ParsePredicateBetween((yylsp[-3]).first_line, (yylsp[-3]).first_column, (yyvsp[-4].expression_), (yyvsp[-2].expression_), (yyvsp[0].expression_));
   }
+#line 4202 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 159:
-/* Line 1787 of yacc.c  */
-#line 1239 "../SqlParser.ypp"
+#line 1282 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.function_call_) = new quickstep::ParseFunctionCall(
-        (yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(1) - (3)].string_value_), new quickstep::PtrList<quickstep::ParseExpression>());
+    (yyval.predicate_) = new quickstep::ParsePredicateNegation(
+        (yylsp[-4]).first_line, (yylsp[-4]).first_column,
+        new quickstep::ParsePredicateBetween((yylsp[-3]).first_line, (yylsp[-3]).first_column, (yyvsp[-5].expression_), (yyvsp[-2].expression_), (yyvsp[0].expression_)));
   }
+#line 4212 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 160:
-/* Line 1787 of yacc.c  */
-#line 1243 "../SqlParser.ypp"
+#line 1287 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.function_call_) = new quickstep::ParseFunctionCall(
-        (yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column, (yyvsp[(1) - (4)].string_value_), new quickstep::ParseStar((yylsp[(3) - (4)]).first_line, (yylsp[(3) - (4)]).first_column));
+    delete (yyvsp[-3].attribute_);
+    (yyval.predicate_) = nullptr;
+    NotSupported(&(yylsp[-2]), yyscanner, "NULL comparison predicates");
+    YYERROR;
   }
+#line 4223 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 161:
-/* Line 1787 of yacc.c  */
-#line 1247 "../SqlParser.ypp"
+#line 1293 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.function_call_) = new quickstep::ParseFunctionCall((yylsp[(1) - (4)]).first_line, (yylsp[(1) - (4)]).first_column, (yyvsp[(1) - (4)].string_value_), (yyvsp[(3) - (4)].expression_list_));
+    delete (yyvsp[-2].attribute_);
+    (yyval.predicate_) = nullptr;
+    NotSupported(&(yylsp[-1]), yyscanner, "NULL comparison predicates");
+    YYERROR;
   }
+#line 4234 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 162:
-/* Line 1787 of yacc.c  */
-#line 1252 "../SqlParser.ypp"
+#line 1299 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_list_) = new quickstep::PtrList<quickstep::ParseExpression>();
-    (yyval.expression_list_)->push_back((yyvsp[(1) - (1)].expression_));
+    delete (yyvsp[-2].expression_);
+    delete (yyvsp[0].string_value_);
+    (yyval.predicate_) = nullptr;
+    NotSupported(&(yylsp[-1]), yyscanner, "LIKE predicates");
+    YYERROR;
   }
+#line 4246 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 163:
-/* Line 1787 of yacc.c  */
-#line 1256 "../SqlParser.ypp"
+#line 1306 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.expression_list_) = (yyvsp[(1) - (3)].expression_list_);
-    (yyval.expression_list_)->push_back((yyvsp[(3) - (3)].expression_));
+    (yyval.predicate_) = new quickstep::ParsePredicateComparison((yylsp[-1]).first_line, (yylsp[-1]).first_column, *(yyvsp[-1].comparison_), (yyvsp[-2].expression_), (yyvsp[0].expression_));
   }
+#line 4254 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 164:
-/* Line 1787 of yacc.c  */
-#line 1262 "../SqlParser.ypp"
+#line 1309 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.literal_value_) = new quickstep::NullParseLiteralValue((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column);
+    (yyval.predicate_) = (yyvsp[-1].predicate_);
   }
+#line 4262 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 165:
-/* Line 1787 of yacc.c  */
-#line 1265 "../SqlParser.ypp"
+#line 1316 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.literal_value_) = (yyvsp[(1) - (1)].numeric_literal_value_);
+    (yyval.expression_) = new quickstep::ParseBinaryExpression((yylsp[-1]).first_line, (yylsp[-1]).first_column, *(yyvsp[-1].binary_operation_), (yyvsp[-2].expression_), (yyvsp[0].expression_));
   }
+#line 4270 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 166:
-/* Line 1787 of yacc.c  */
-#line 1268 "../SqlParser.ypp"
+#line 1319 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.literal_value_) = (yyvsp[(2) - (2)].numeric_literal_value_);
+    (yyval.expression_) = (yyvsp[0].expression_);
   }
+#line 4278 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
   case 167:
-/* Line 1787 of yacc.c  */
-#line 1271 "../SqlParser.ypp"
+#line 1324 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_) = new quickstep::ParseBinaryExpression((yylsp[-1]).first_line, (yylsp[-1]).first_column, *(yyvsp[-1].binary_operation_), (yyvsp[-2].expression_), (yyvsp[0].expression_));
+  }
+#line 4286 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 168:
+#line 1327 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_) = (yyvsp[0].expression_);
+  }
+#line 4294 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 169:
+#line 1332 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_) = new quickstep::ParseUnaryExpression((yylsp[-1]).first_line, (yylsp[-1]).first_column, *(yyvsp[-1].unary_operation_), (yyvsp[0].expression_));
+  }
+#line 4302 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 170:
+#line 1335 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_) = (yyvsp[0].expression_);
+  }
+#line 4310 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 171:
+#line 1340 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_) = (yyvsp[0].attribute_);
+  }
+#line 4318 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 172:
+#line 1343 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_) = new quickstep::ParseScalarLiteral((yyvsp[0].literal_value_));
+  }
+#line 4326 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 173:
+#line 1346 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_) = (yyvsp[0].function_call_);
+  }
+#line 4334 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 174:
+#line 1349 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_) = (yyvsp[-1].expression_);
+  }
+#line 4342 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 175:
+#line 1354 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.function_call_) = new quickstep::ParseFunctionCall(
+        (yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[-2].string_value_), new quickstep::PtrList<quickstep::ParseExpression>());
+  }
+#line 4351 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 176:
+#line 1358 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.function_call_) = new quickstep::ParseFunctionCall(
+        (yylsp[-3]).first_line, (yylsp[-3]).first_column, (yyvsp[-3].string_value_), new quickstep::ParseStar((yylsp[-1]).first_line, (yylsp[-1]).first_column));
+  }
+#line 4360 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 177:
+#line 1362 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.function_call_) = new quickstep::ParseFunctionCall((yylsp[-3]).first_line, (yylsp[-3]).first_column, (yyvsp[-3].string_value_), (yyvsp[-1].expression_list_));
+  }
+#line 4368 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 178:
+#line 1367 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_list_) = new quickstep::PtrList<quickstep::ParseExpression>();
+    (yyval.expression_list_)->push_back((yyvsp[0].expression_));
+  }
+#line 4377 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 179:
+#line 1371 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.expression_list_) = (yyvsp[-2].expression_list_);
+    (yyval.expression_list_)->push_back((yyvsp[0].expression_));
+  }
+#line 4386 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 180:
+#line 1377 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.literal_value_) = new quickstep::NullParseLiteralValue((yylsp[0]).first_line, (yylsp[0]).first_column);
+  }
+#line 4394 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 181:
+#line 1380 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.literal_value_) = (yyvsp[0].numeric_literal_value_);
+  }
+#line 4402 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 182:
+#line 1383 "../SqlParser.ypp" /* yacc.c:1661  */
+    {
+    (yyval.literal_value_) = (yyvsp[0].numeric_literal_value_);
+  }
+#line 4410 "SqlParser_gen.cpp" /* yacc.c:1661  */
+    break;
+
+  case 183:
+#line 1386 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     /**
      * NOTE(chasseur): This case exhibits a shift/reduce conflict with the
@@ -4423,23 +4420,23 @@
      * pattern as a negative number literal rather than a unary minus operation
      * applied to a non-negative number literal).
      **/
-    (yyvsp[(2) - (2)].numeric_literal_value_)->prependMinus();
-    (yyval.literal_value_) = (yyvsp[(2) - (2)].numeric_literal_value_);
+    (yyvsp[0].numeric_literal_value_)->prependMinus();
+    (yyval.literal_value_) = (yyvsp[0].numeric_literal_value_);
   }
+#line 4427 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 168:
-/* Line 1787 of yacc.c  */
-#line 1283 "../SqlParser.ypp"
+  case 184:
+#line 1398 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.literal_value_) = new quickstep::StringParseLiteralValue((yyvsp[(1) - (1)].string_value_),
+    (yyval.literal_value_) = new quickstep::StringParseLiteralValue((yyvsp[0].string_value_),
                                                 nullptr);  // No explicit type.
   }
+#line 4436 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 169:
-/* Line 1787 of yacc.c  */
-#line 1287 "../SqlParser.ypp"
+  case 185:
+#line 1402 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     /**
      * NOTE(chasseur): This case exhibits a shift/reduce conflict with the
@@ -4451,119 +4448,119 @@
      * error being emitted because of an ambiguous type).
      **/
     quickstep::StringParseLiteralValue *parse_value;
-    if (quickstep::StringParseLiteralValue::ParseAmbiguousInterval((yyvsp[(2) - (2)].string_value_), &parse_value)) {
+    if (quickstep::StringParseLiteralValue::ParseAmbiguousInterval((yyvsp[0].string_value_), &parse_value)) {
       (yyval.literal_value_) = parse_value;
     } else {
       (yyval.literal_value_) = nullptr;
-      quickstep_yyerror(&(yylsp[(2) - (2)]), yyscanner, nullptr, "Failed to parse literal as specified type");
+      quickstep_yyerror(&(yylsp[0]), yyscanner, nullptr, "Failed to parse literal as specified type");
       YYERROR;
     }
   }
+#line 4460 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 170:
-/* Line 1787 of yacc.c  */
-#line 1306 "../SqlParser.ypp"
+  case 186:
+#line 1421 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     quickstep::StringParseLiteralValue *parse_value
-        = new quickstep::StringParseLiteralValue((yyvsp[(2) - (2)].string_value_), &((yyvsp[(1) - (2)].data_type_)->getType()));
-    delete (yyvsp[(1) - (2)].data_type_);
+        = new quickstep::StringParseLiteralValue((yyvsp[0].string_value_), &((yyvsp[-1].data_type_)->getType()));
+    delete (yyvsp[-1].data_type_);
     if (!parse_value->tryExplicitTypeParse()) {
       delete parse_value;
       (yyval.literal_value_) = nullptr;
-      quickstep_yyerror(&(yylsp[(2) - (2)]), yyscanner, nullptr, "Failed to parse literal as specified type");
+      quickstep_yyerror(&(yylsp[0]), yyscanner, nullptr, "Failed to parse literal as specified type");
       YYERROR;
     } else {
       (yyval.literal_value_) = parse_value;
     }
   }
+#line 4478 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 171:
-/* Line 1787 of yacc.c  */
-#line 1321 "../SqlParser.ypp"
+  case 187:
+#line 1436 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.literal_value_list_) = new quickstep::PtrList<quickstep::ParseScalarLiteral>();
-    (yyval.literal_value_list_)->push_back(new quickstep::ParseScalarLiteral((yyvsp[(1) - (1)].literal_value_)));
+    (yyval.literal_value_list_)->push_back(new quickstep::ParseScalarLiteral((yyvsp[0].literal_value_)));
   }
+#line 4487 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 172:
-/* Line 1787 of yacc.c  */
-#line 1325 "../SqlParser.ypp"
+  case 188:
+#line 1440 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.literal_value_list_) = (yyvsp[(1) - (3)].literal_value_list_);
-    (yyval.literal_value_list_)->push_back(new quickstep::ParseScalarLiteral((yyvsp[(3) - (3)].literal_value_)));
+    (yyval.literal_value_list_) = (yyvsp[-2].literal_value_list_);
+    (yyval.literal_value_list_)->push_back(new quickstep::ParseScalarLiteral((yyvsp[0].literal_value_)));
   }
+#line 4496 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 173:
-/* Line 1787 of yacc.c  */
-#line 1331 "../SqlParser.ypp"
+  case 189:
+#line 1446 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.attribute_) = new quickstep::ParseAttribute((yylsp[(1) - (1)]).first_line, (yylsp[(1) - (1)]).first_column, (yyvsp[(1) - (1)].string_value_));
+    (yyval.attribute_) = new quickstep::ParseAttribute((yylsp[0]).first_line, (yylsp[0]).first_column, (yyvsp[0].string_value_));
   }
+#line 4504 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 174:
-/* Line 1787 of yacc.c  */
-#line 1334 "../SqlParser.ypp"
+  case 190:
+#line 1449 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.attribute_) = new quickstep::ParseAttribute((yylsp[(1) - (3)]).first_line, (yylsp[(1) - (3)]).first_column, (yyvsp[(3) - (3)].string_value_), (yyvsp[(1) - (3)].string_value_));
+    (yyval.attribute_) = new quickstep::ParseAttribute((yylsp[-2]).first_line, (yylsp[-2]).first_column, (yyvsp[0].string_value_), (yyvsp[-2].string_value_));
   }
+#line 4512 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 175:
-/* Line 1787 of yacc.c  */
-#line 1340 "../SqlParser.ypp"
+  case 191:
+#line 1455 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.comparison_) = &quickstep::ComparisonFactory::GetComparison(quickstep::ComparisonID::kEqual);
   }
+#line 4520 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 176:
-/* Line 1787 of yacc.c  */
-#line 1343 "../SqlParser.ypp"
+  case 192:
+#line 1458 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.comparison_) = &quickstep::ComparisonFactory::GetComparison(quickstep::ComparisonID::kNotEqual);
   }
+#line 4528 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 177:
-/* Line 1787 of yacc.c  */
-#line 1346 "../SqlParser.ypp"
+  case 193:
+#line 1461 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.comparison_) = &quickstep::ComparisonFactory::GetComparison(quickstep::ComparisonID::kLess);
   }
+#line 4536 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 178:
-/* Line 1787 of yacc.c  */
-#line 1349 "../SqlParser.ypp"
+  case 194:
+#line 1464 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.comparison_) = &quickstep::ComparisonFactory::GetComparison(quickstep::ComparisonID::kLessOrEqual);
   }
+#line 4544 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 179:
-/* Line 1787 of yacc.c  */
-#line 1352 "../SqlParser.ypp"
+  case 195:
+#line 1467 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.comparison_) = &quickstep::ComparisonFactory::GetComparison(quickstep::ComparisonID::kGreater);
   }
+#line 4552 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 180:
-/* Line 1787 of yacc.c  */
-#line 1355 "../SqlParser.ypp"
+  case 196:
+#line 1470 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.comparison_) = &quickstep::ComparisonFactory::GetComparison(quickstep::ComparisonID::kGreaterOrEqual);
   }
+#line 4560 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 181:
-/* Line 1787 of yacc.c  */
-#line 1360 "../SqlParser.ypp"
+  case 197:
+#line 1475 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     /**
      * NOTE(chasseur): This case exhibits a shift/reduce conflict with the
@@ -4573,112 +4570,112 @@
      **/
     (yyval.unary_operation_) = &quickstep::UnaryOperationFactory::GetUnaryOperation(quickstep::UnaryOperationID::kNegate);
   }
+#line 4574 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 182:
-/* Line 1787 of yacc.c  */
-#line 1371 "../SqlParser.ypp"
+  case 198:
+#line 1486 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.binary_operation_) = &quickstep::BinaryOperationFactory::GetBinaryOperation(quickstep::BinaryOperationID::kAdd);
   }
+#line 4582 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 183:
-/* Line 1787 of yacc.c  */
-#line 1374 "../SqlParser.ypp"
+  case 199:
+#line 1489 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.binary_operation_) = &quickstep::BinaryOperationFactory::GetBinaryOperation(quickstep::BinaryOperationID::kSubtract);
   }
+#line 4590 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 184:
-/* Line 1787 of yacc.c  */
-#line 1379 "../SqlParser.ypp"
+  case 200:
+#line 1494 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.binary_operation_) = &quickstep::BinaryOperationFactory::GetBinaryOperation(quickstep::BinaryOperationID::kMultiply);
   }
+#line 4598 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 185:
-/* Line 1787 of yacc.c  */
-#line 1382 "../SqlParser.ypp"
+  case 201:
+#line 1497 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.binary_operation_) = &quickstep::BinaryOperationFactory::GetBinaryOperation(quickstep::BinaryOperationID::kDivide);
   }
+#line 4606 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 186:
-/* Line 1787 of yacc.c  */
-#line 1388 "../SqlParser.ypp"
+  case 202:
+#line 1503 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.string_list_) = new quickstep::PtrList<quickstep::ParseString>();
-    (yyval.string_list_)->push_back((yyvsp[(1) - (1)].string_value_));
+    (yyval.string_list_)->push_back((yyvsp[0].string_value_));
   }
+#line 4615 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 187:
-/* Line 1787 of yacc.c  */
-#line 1392 "../SqlParser.ypp"
+  case 203:
+#line 1507 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.string_list_) = (yyvsp[(1) - (3)].string_list_);
-    (yyval.string_list_)->push_back((yyvsp[(3) - (3)].string_value_));
+    (yyval.string_list_) = (yyvsp[-2].string_list_);
+    (yyval.string_list_)->push_back((yyvsp[0].string_value_));
   }
+#line 4624 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 188:
-/* Line 1787 of yacc.c  */
-#line 1398 "../SqlParser.ypp"
+  case 204:
+#line 1513 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    (yyval.string_value_) = (yyvsp[(1) - (1)].string_value_);
+    (yyval.string_value_) = (yyvsp[0].string_value_);
   }
+#line 4632 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 189:
-/* Line 1787 of yacc.c  */
-#line 1401 "../SqlParser.ypp"
+  case 205:
+#line 1516 "../SqlParser.ypp" /* yacc.c:1661  */
     {
-    if ((yyvsp[(1) - (1)].string_value_)->value().empty()) {
-      quickstep_yyerror(&(yylsp[(1) - (1)]), yyscanner, nullptr, "Zero-length identifier");
+    if ((yyvsp[0].string_value_)->value().empty()) {
+      quickstep_yyerror(&(yylsp[0]), yyscanner, nullptr, "Zero-length identifier");
     }
-    (yyval.string_value_) = (yyvsp[(1) - (1)].string_value_);
+    (yyval.string_value_) = (yyvsp[0].string_value_);
   }
+#line 4643 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 190:
-/* Line 1787 of yacc.c  */
-#line 1409 "../SqlParser.ypp"
+  case 206:
+#line 1524 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.boolean_value_) = true;
   }
+#line 4651 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 191:
-/* Line 1787 of yacc.c  */
-#line 1412 "../SqlParser.ypp"
+  case 207:
+#line 1527 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.boolean_value_) = true;
   }
+#line 4659 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 192:
-/* Line 1787 of yacc.c  */
-#line 1415 "../SqlParser.ypp"
+  case 208:
+#line 1530 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.boolean_value_) = false;
   }
+#line 4667 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
-  case 193:
-/* Line 1787 of yacc.c  */
-#line 1418 "../SqlParser.ypp"
+  case 209:
+#line 1533 "../SqlParser.ypp" /* yacc.c:1661  */
     {
     (yyval.boolean_value_) = false;
   }
+#line 4675 "SqlParser_gen.cpp" /* yacc.c:1661  */
     break;
 
 
-/* Line 1787 of yacc.c  */
-#line 4682 "SqlParser_gen.cpp"
+#line 4679 "SqlParser_gen.cpp" /* yacc.c:1661  */
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -4701,7 +4698,7 @@
   *++yyvsp = yyval;
   *++yylsp = yyloc;
 
-  /* Now `shift' the result of the reduction.  Determine what state
+  /* Now 'shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
 
@@ -4716,9 +4713,9 @@
   goto yynewstate;
 
 
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error.  |
+`--------------------------------------*/
 yyerrlab:
   /* Make sure we have latest lookahead translation.  See comments at
      user semantic actions for why this is necessary.  */
@@ -4769,20 +4766,20 @@
   if (yyerrstatus == 3)
     {
       /* If just tried and failed to reuse lookahead token after an
-	 error, discard it.  */
+         error, discard it.  */
 
       if (yychar <= YYEOF)
-	{
-	  /* Return failure if at end of input.  */
-	  if (yychar == YYEOF)
-	    YYABORT;
-	}
+        {
+          /* Return failure if at end of input.  */
+          if (yychar == YYEOF)
+            YYABORT;
+        }
       else
-	{
-	  yydestruct ("Error: discarding",
-		      yytoken, &yylval, &yylloc, yyscanner, parsedStatement);
-	  yychar = YYEMPTY;
-	}
+        {
+          yydestruct ("Error: discarding",
+                      yytoken, &yylval, &yylloc, yyscanner, parsedStatement);
+          yychar = YYEMPTY;
+        }
     }
 
   /* Else will try to reuse lookahead token after shifting the error
@@ -4802,7 +4799,7 @@
      goto yyerrorlab;
 
   yyerror_range[1] = yylsp[1-yylen];
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
   yylen = 0;
@@ -4815,29 +4812,29 @@
 | yyerrlab1 -- common code for both syntax error and YYERROR.  |
 `-------------------------------------------------------------*/
 yyerrlab1:
-  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
 
   for (;;)
     {
       yyn = yypact[yystate];
       if (!yypact_value_is_default (yyn))
-	{
-	  yyn += YYTERROR;
-	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-	    {
-	      yyn = yytable[yyn];
-	      if (0 < yyn)
-		break;
-	    }
-	}
+        {
+          yyn += YYTERROR;
+          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+            {
+              yyn = yytable[yyn];
+              if (0 < yyn)
+                break;
+            }
+        }
 
       /* Pop the current state because it cannot handle the error token.  */
       if (yyssp == yyss)
-	YYABORT;
+        YYABORT;
 
       yyerror_range[1] = *yylsp;
       yydestruct ("Error: popping",
-		  yystos[yystate], yyvsp, yylsp, yyscanner, parsedStatement);
+                  yystos[yystate], yyvsp, yylsp, yyscanner, parsedStatement);
       YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
@@ -4893,14 +4890,14 @@
       yydestruct ("Cleanup: discarding lookahead",
                   yytoken, &yylval, &yylloc, yyscanner, parsedStatement);
     }
-  /* Do not reclaim the symbols of the rule which action triggered
+  /* Do not reclaim the symbols of the rule whose action triggered
      this YYABORT or YYACCEPT.  */
   YYPOPSTACK (yylen);
   YY_STACK_PRINT (yyss, yyssp);
   while (yyssp != yyss)
     {
       yydestruct ("Cleanup: popping",
-		  yystos[*yyssp], yyvsp, yylsp, yyscanner, parsedStatement);
+                  yystos[*yyssp], yyvsp, yylsp, yyscanner, parsedStatement);
       YYPOPSTACK (1);
     }
 #ifndef yyoverflow
@@ -4911,13 +4908,9 @@
   if (yymsg != yymsgbuf)
     YYSTACK_FREE (yymsg);
 #endif
-  /* Make sure YYID is used.  */
-  return YYID (yyresult);
+  return yyresult;
 }
-
-
-/* Line 2050 of yacc.c  */
-#line 1422 "../SqlParser.ypp"
+#line 1537 "../SqlParser.ypp" /* yacc.c:1906  */
 
 
 void NotSupported(const YYLTYPE *location, yyscan_t yyscanner, const std::string &feature) {
diff --git a/parser/preprocessed/SqlParser_gen.hpp b/parser/preprocessed/SqlParser_gen.hpp
index a4adc2f..5cf0011 100644
--- a/parser/preprocessed/SqlParser_gen.hpp
+++ b/parser/preprocessed/SqlParser_gen.hpp
@@ -1,19 +1,19 @@
-/* A Bison parser, made by GNU Bison 2.7.12-4996.  */
+/* A Bison parser, made by GNU Bison 3.0.4.  */
 
 /* Bison interface for Yacc-like parsers in C
-   
-      Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
-   
+
+   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
@@ -26,13 +26,13 @@
    special exception, which will cause the skeleton and the resulting
    Bison output files to be licensed under the GNU General Public
    License without this special exception.
-   
+
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
 #ifndef YY_QUICKSTEP_YY_SQLPARSER_GEN_HPP_INCLUDED
 # define YY_QUICKSTEP_YY_SQLPARSER_GEN_HPP_INCLUDED
-/* Enabling traces.  */
+/* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
 #endif
@@ -40,111 +40,114 @@
 extern int quickstep_yydebug;
 #endif
 
-/* Tokens.  */
+/* Token type.  */
 #ifndef YYTOKENTYPE
 # define YYTOKENTYPE
-   /* Put the tokens into the symbol table, so that GDB and other debuggers
-      know about them.  */
-   enum yytokentype {
-     TOKEN_NAME = 258,
-     TOKEN_STRING_SINGLE_QUOTED = 259,
-     TOKEN_STRING_DOUBLE_QUOTED = 260,
-     TOKEN_UNSIGNED_NUMVAL = 261,
-     TOKEN_OR = 262,
-     TOKEN_AND = 263,
-     TOKEN_NOT = 264,
-     TOKEN_EQ = 265,
-     TOKEN_NEQ = 266,
-     TOKEN_GEQ = 267,
-     TOKEN_GT = 268,
-     TOKEN_LEQ = 269,
-     TOKEN_LT = 270,
-     TOKEN_LIKE = 271,
-     TOKEN_BETWEEN = 272,
-     TOKEN_IS = 273,
-     UNARY_MINUS = 274,
-     UNARY_PLUS = 275,
-     TOKEN_ADD = 276,
-     TOKEN_ALL = 277,
-     TOKEN_ALTER = 278,
-     TOKEN_AS = 279,
-     TOKEN_ASC = 280,
-     TOKEN_BIGINT = 281,
-     TOKEN_BIT = 282,
-     TOKEN_BY = 283,
-     TOKEN_CHARACTER = 284,
-     TOKEN_CHECK = 285,
-     TOKEN_COLUMN = 286,
-     TOKEN_CONSTRAINT = 287,
-     TOKEN_COPY = 288,
-     TOKEN_CREATE = 289,
-     TOKEN_DATE = 290,
-     TOKEN_DATETIME = 291,
-     TOKEN_DECIMAL = 292,
-     TOKEN_DEFAULT = 293,
-     TOKEN_DELETE = 294,
-     TOKEN_DELIMITER = 295,
-     TOKEN_DESC = 296,
-     TOKEN_DISTINCT = 297,
-     TOKEN_DOUBLE = 298,
-     TOKEN_DROP = 299,
-     TOKEN_ESCAPE_STRINGS = 300,
-     TOKEN_FALSE = 301,
-     TOKEN_FIRST = 302,
-     TOKEN_FLOAT = 303,
-     TOKEN_FOREIGN = 304,
-     TOKEN_FROM = 305,
-     TOKEN_FULL = 306,
-     TOKEN_GROUP = 307,
-     TOKEN_HAVING = 308,
-     TOKEN_INNER = 309,
-     TOKEN_INSERT = 310,
-     TOKEN_INTEGER = 311,
-     TOKEN_INTERVAL = 312,
-     TOKEN_INTO = 313,
-     TOKEN_JOIN = 314,
-     TOKEN_KEY = 315,
-     TOKEN_LAST = 316,
-     TOKEN_LEFT = 317,
-     TOKEN_LIMIT = 318,
-     TOKEN_LONG = 319,
-     TOKEN_NULL = 320,
-     TOKEN_NULLS = 321,
-     TOKEN_OFF = 322,
-     TOKEN_ON = 323,
-     TOKEN_ORDER = 324,
-     TOKEN_OUTER = 325,
-     TOKEN_PRIMARY = 326,
-     TOKEN_QUIT = 327,
-     TOKEN_REAL = 328,
-     TOKEN_REFERENCES = 329,
-     TOKEN_RIGHT = 330,
-     TOKEN_ROW_DELIMITER = 331,
-     TOKEN_SELECT = 332,
-     TOKEN_SET = 333,
-     TOKEN_SMALLINT = 334,
-     TOKEN_TABLE = 335,
-     TOKEN_TIME = 336,
-     TOKEN_TIMESTAMP = 337,
-     TOKEN_TRUE = 338,
-     TOKEN_UNIQUE = 339,
-     TOKEN_UPDATE = 340,
-     TOKEN_VALUES = 341,
-     TOKEN_VARCHAR = 342,
-     TOKEN_WHERE = 343,
-     TOKEN_WITH = 344,
-     TOKEN_YEARMONTH = 345,
-     TOKEN_EOF = 346,
-     TOKEN_LEX_ERROR = 347
-   };
+  enum yytokentype
+  {
+    TOKEN_NAME = 258,
+    TOKEN_STRING_SINGLE_QUOTED = 259,
+    TOKEN_STRING_DOUBLE_QUOTED = 260,
+    TOKEN_UNSIGNED_NUMVAL = 261,
+    TOKEN_OR = 262,
+    TOKEN_AND = 263,
+    TOKEN_NOT = 264,
+    TOKEN_EQ = 265,
+    TOKEN_LT = 266,
+    TOKEN_LEQ = 267,
+    TOKEN_GT = 268,
+    TOKEN_GEQ = 269,
+    TOKEN_NEQ = 270,
+    TOKEN_LIKE = 271,
+    TOKEN_BETWEEN = 272,
+    TOKEN_IS = 273,
+    UNARY_PLUS = 274,
+    UNARY_MINUS = 275,
+    TOKEN_ADD = 276,
+    TOKEN_ALL = 277,
+    TOKEN_ALTER = 278,
+    TOKEN_AS = 279,
+    TOKEN_ASC = 280,
+    TOKEN_BIGINT = 281,
+    TOKEN_BIT = 282,
+    TOKEN_BLOOM_FILTER = 283,
+    TOKEN_CSB_TREE = 284,
+    TOKEN_BY = 285,
+    TOKEN_CHARACTER = 286,
+    TOKEN_CHECK = 287,
+    TOKEN_COLUMN = 288,
+    TOKEN_CONSTRAINT = 289,
+    TOKEN_COPY = 290,
+    TOKEN_CREATE = 291,
+    TOKEN_DATE = 292,
+    TOKEN_DATETIME = 293,
+    TOKEN_DECIMAL = 294,
+    TOKEN_DEFAULT = 295,
+    TOKEN_DELETE = 296,
+    TOKEN_DELIMITER = 297,
+    TOKEN_DESC = 298,
+    TOKEN_DISTINCT = 299,
+    TOKEN_DOUBLE = 300,
+    TOKEN_DROP = 301,
+    TOKEN_ESCAPE_STRINGS = 302,
+    TOKEN_FALSE = 303,
+    TOKEN_FIRST = 304,
+    TOKEN_FLOAT = 305,
+    TOKEN_FOREIGN = 306,
+    TOKEN_FROM = 307,
+    TOKEN_FULL = 308,
+    TOKEN_GROUP = 309,
+    TOKEN_HAVING = 310,
+    TOKEN_INDEX = 311,
+    TOKEN_INNER = 312,
+    TOKEN_INSERT = 313,
+    TOKEN_INTEGER = 314,
+    TOKEN_INTERVAL = 315,
+    TOKEN_INTO = 316,
+    TOKEN_JOIN = 317,
+    TOKEN_KEY = 318,
+    TOKEN_LAST = 319,
+    TOKEN_LEFT = 320,
+    TOKEN_LIMIT = 321,
+    TOKEN_LONG = 322,
+    TOKEN_NULL = 323,
+    TOKEN_NULLS = 324,
+    TOKEN_OFF = 325,
+    TOKEN_ON = 326,
+    TOKEN_ORDER = 327,
+    TOKEN_OUTER = 328,
+    TOKEN_PRIMARY = 329,
+    TOKEN_QUIT = 330,
+    TOKEN_REAL = 331,
+    TOKEN_REFERENCES = 332,
+    TOKEN_RIGHT = 333,
+    TOKEN_ROW_DELIMITER = 334,
+    TOKEN_SELECT = 335,
+    TOKEN_SET = 336,
+    TOKEN_SMALLINT = 337,
+    TOKEN_TABLE = 338,
+    TOKEN_TIME = 339,
+    TOKEN_TIMESTAMP = 340,
+    TOKEN_TRUE = 341,
+    TOKEN_UNIQUE = 342,
+    TOKEN_UPDATE = 343,
+    TOKEN_USING = 344,
+    TOKEN_VALUES = 345,
+    TOKEN_VARCHAR = 346,
+    TOKEN_WHERE = 347,
+    TOKEN_WITH = 348,
+    TOKEN_YEARMONTH = 349,
+    TOKEN_EOF = 350,
+    TOKEN_LEX_ERROR = 351
+  };
 #endif
 
-
+/* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
+
+union YYSTYPE
 {
-/* Line 2053 of yacc.c  */
-#line 105 "../SqlParser.ypp"
+#line 106 "../SqlParser.ypp" /* yacc.c:1915  */
 
   quickstep::ParseString *string_value_;
 
@@ -179,6 +182,12 @@
   quickstep::PtrList<quickstep::ParseColumnConstraint> *column_constraint_list_;
   quickstep::PtrList<quickstep::ParseAttributeDefinition> *attribute_definition_list_;
 
+  quickstep::ParseKeyValue *key_value_;
+  quickstep::PtrList<quickstep::ParseKeyValue> *key_value_list_;
+  quickstep::ParseKeyStringValue *key_string_value_;
+  quickstep::ParseKeyStringList *key_string_list_;
+  quickstep::ParseKeyLiteralValue *key_literal_value_;
+
   quickstep::ParseCopyFromParams *copy_from_params_;
 
   quickstep::ParseAssignment *assignment_;
@@ -214,41 +223,30 @@
   quickstep::PtrVector<quickstep::ParseSubqueryTableReference> *with_list_;
   quickstep::ParseSubqueryTableReference *with_list_element_;
 
+#line 227 "SqlParser_gen.hpp" /* yacc.c:1915  */
+};
 
-/* Line 2053 of yacc.c  */
-#line 220 "SqlParser_gen.hpp"
-} YYSTYPE;
+typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 #endif
 
+/* Location type.  */
 #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
-typedef struct YYLTYPE
+typedef struct YYLTYPE YYLTYPE;
+struct YYLTYPE
 {
   int first_line;
   int first_column;
   int last_line;
   int last_column;
-} YYLTYPE;
-# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+};
 # define YYLTYPE_IS_DECLARED 1
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
 
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int quickstep_yyparse (void *YYPARSE_PARAM);
-#else
-int quickstep_yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
+
 int quickstep_yyparse (yyscan_t yyscanner, quickstep::ParseStatement **parsedStatement);
-#else
-int quickstep_yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
 
 #endif /* !YY_QUICKSTEP_YY_SQLPARSER_GEN_HPP_INCLUDED  */
diff --git a/parser/tests/Aggregate.test b/parser/tests/Aggregate.test
index 47bbab8..3fbf3f1 100644
--- a/parser/tests/Aggregate.test
+++ b/parser/tests/Aggregate.test
@@ -13,17 +13,17 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-select agg(*), agg(), agg(a, b, c) from test
+SELECT AGG(*), AGG(), AGG(a, b, c) FROM test
 --
 SelectStatement
 +-select_query=Select
   +-select_clause=SelectList
   | +-SelectListItem
-  | | +-FunctionCall[name=agg,is_star=true]
+  | | +-FunctionCall[name=AGG,is_star=true]
   | +-SelectListItem
-  | | +-FunctionCall[name=agg]
+  | | +-FunctionCall[name=AGG]
   | +-SelectListItem
-  |   +-FunctionCall[name=agg]
+  |   +-FunctionCall[name=AGG]
   |     +-AttributeReference[attribute_name=a]
   |     +-AttributeReference[attribute_name=b]
   |     +-AttributeReference[attribute_name=c]
@@ -31,30 +31,30 @@
     +-TableReference[table=test]
 ==
 
-select agg()+1, agg()*2+1+agg(a, b)/agg(c, d) from test
+SELECT AGG()+1, AGG()*2+1+AGG(a, b)/AGG(c, d) FROM test
 --
 SelectStatement
 +-select_query=Select
   +-select_clause=SelectList
   | +-SelectListItem
   | | +-Add
-  | |   +-left_operand=FunctionCall[name=agg]
+  | |   +-left_operand=FunctionCall[name=AGG]
   | |   +-right_operand=Literal
   | |     +-NumericLiteral[numeric_string=1,float_like=false]
   | +-SelectListItem
   |   +-Add
   |     +-left_operand=Add
   |     | +-left_operand=Multiply
-  |     | | +-left_operand=FunctionCall[name=agg]
+  |     | | +-left_operand=FunctionCall[name=AGG]
   |     | | +-right_operand=Literal
   |     | |   +-NumericLiteral[numeric_string=2,float_like=false]
   |     | +-right_operand=Literal
   |     |   +-NumericLiteral[numeric_string=1,float_like=false]
   |     +-right_operand=Divide
-  |       +-left_operand=FunctionCall[name=agg]
+  |       +-left_operand=FunctionCall[name=AGG]
   |       | +-AttributeReference[attribute_name=a]
   |       | +-AttributeReference[attribute_name=b]
-  |       +-right_operand=FunctionCall[name=agg]
+  |       +-right_operand=FunctionCall[name=AGG]
   |         +-AttributeReference[attribute_name=c]
   |         +-AttributeReference[attribute_name=d]
   +-from_clause=
@@ -64,44 +64,44 @@
 # Function calls as arguments of another function calls.
 # This is just for testing purpose. If agg is an aggregation,
 # the query is not valid. The query resolver will capture the error.
-select agg(agg(agg()+1)*2, agg(*)/2.0) from test
+SELECT AGG(AGG(AGG()+1)*2, AGG(*)/2.0) FROM test
 --
 SelectStatement
 +-select_query=Select
   +-select_clause=SelectList
   | +-SelectListItem
-  |   +-FunctionCall[name=agg]
+  |   +-FunctionCall[name=AGG]
   |     +-Multiply
-  |     | +-left_operand=FunctionCall[name=agg]
+  |     | +-left_operand=FunctionCall[name=AGG]
   |     | | +-Add
-  |     | |   +-left_operand=FunctionCall[name=agg]
+  |     | |   +-left_operand=FunctionCall[name=AGG]
   |     | |   +-right_operand=Literal
   |     | |     +-NumericLiteral[numeric_string=1,float_like=false]
   |     | +-right_operand=Literal
   |     |   +-NumericLiteral[numeric_string=2,float_like=false]
   |     +-Divide
-  |       +-left_operand=FunctionCall[name=agg,is_star=true]
+  |       +-left_operand=FunctionCall[name=AGG,is_star=true]
   |       +-right_operand=Literal
   |         +-NumericLiteral[numeric_string=2.0,float_like=true]
   +-from_clause=
     +-TableReference[table=test]
 ==
 
-select agg(*, a) from test
+SELECT AGG(*, a) FROM test
 --
 ERROR: syntax error (1 : 13)
-select agg(*, a) from test
+SELECT AGG(*, a) FROM test
             ^
 ==
 
-select agg()+1 from test group by a+1, agg()+1 having agg()*2>1
+SELECT AGG()+1 FROM test GROUP BY a+1, AGG()+1 HAVING AGG()*2>1
 --
 SelectStatement
 +-select_query=Select
   +-select_clause=SelectList
   | +-SelectListItem
   |   +-Add
-  |     +-left_operand=FunctionCall[name=agg]
+  |     +-left_operand=FunctionCall[name=AGG]
   |     +-right_operand=Literal
   |       +-NumericLiteral[numeric_string=1,float_like=false]
   +-group_by=GroupBy
@@ -110,13 +110,13 @@
   | | +-right_operand=Literal
   | |   +-NumericLiteral[numeric_string=1,float_like=false]
   | +-Add
-  |   +-left_operand=FunctionCall[name=agg]
+  |   +-left_operand=FunctionCall[name=AGG]
   |   +-right_operand=Literal
   |     +-NumericLiteral[numeric_string=1,float_like=false]
   +-having=HAVING
   | +-Greater
   |   +-left_operand=Multiply
-  |   | +-left_operand=FunctionCall[name=agg]
+  |   | +-left_operand=FunctionCall[name=AGG]
   |   | +-right_operand=Literal
   |   |   +-NumericLiteral[numeric_string=2,float_like=false]
   |   +-right_operand=Literal
@@ -125,7 +125,7 @@
     +-TableReference[table=test]
 ==
 
-select 1 from test having agg() > 1 and 1=1
+SELECT 1 FROM test HAVING AGG() > 1 AND 1=1
 --
 SelectStatement
 +-select_query=Select
@@ -136,7 +136,7 @@
   +-having=HAVING
   | +-And
   |   +-Greater
-  |   | +-left_operand=FunctionCall[name=agg]
+  |   | +-left_operand=FunctionCall[name=AGG]
   |   | +-right_operand=Literal
   |   |   +-NumericLiteral[numeric_string=1,float_like=false]
   |   +-Equal
@@ -148,7 +148,7 @@
     +-TableReference[table=test]
 ==
 
-select 1 from test group by agg()+1, agg()/agg()
+SELECT 1 FROM test GROUP BY AGG()+1, AGG()/AGG()
 --
 SelectStatement
 +-select_query=Select
@@ -158,11 +158,11 @@
   |     +-NumericLiteral[numeric_string=1,float_like=false]
   +-group_by=GroupBy
   | +-Add
-  | | +-left_operand=FunctionCall[name=agg]
+  | | +-left_operand=FunctionCall[name=AGG]
   | | +-right_operand=Literal
   | |   +-NumericLiteral[numeric_string=1,float_like=false]
   | +-Divide
-  |   +-left_operand=FunctionCall[name=agg]
-  |   +-right_operand=FunctionCall[name=agg]
+  |   +-left_operand=FunctionCall[name=AGG]
+  |   +-right_operand=FunctionCall[name=AGG]
   +-from_clause=
     +-TableReference[table=test]
diff --git a/parser/tests/Alter.test b/parser/tests/Alter.test
index bdebd3e..dd38eea 100644
--- a/parser/tests/Alter.test
+++ b/parser/tests/Alter.test
@@ -13,41 +13,39 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-alter table test
-add attr int
+ALTER TABLE test
+ADD attr INT
 --
 ERROR: syntax error (2 : 5)
-add attr int
+ADD attr INT
     ^
 ==
 
-alter table test
-add column attr int
+ALTER TABLE test
+ADD COLUMN attr INT
 --
 ERROR: ALTER statements is not supported yet (1 : 1)
-alter table test
+ALTER TABLE test
 ^
 ==
 
-alter table test
-drop column attr int
+ALTER TABLE test
+DROP COLUMN attr INT
 --
-ERROR: ALTER statements is not supported yet (1 : 1)
-alter table test
-^
+[same as above]
 ==
 
-alter table test
-add constraint unique(attr)
+ALTER TABLE test
+ADD CONSTRAINT UNIQUE(attr)
 --
 ERROR: Table Constraints (UNIQUE) is not supported yet (2 : 16)
-add constraint unique(attr)
+ADD CONSTRAINT UNIQUE(attr)
                ^
 ==
 
-alter table test
-drop constraint constraint0
+ALTER TABLE test
+DROP CONSTRAINT constraint0
 --
 ERROR: ALTER statements is not supported yet (1 : 1)
-alter table test
+ALTER TABLE test
 ^
diff --git a/parser/tests/CMakeLists.txt b/parser/tests/CMakeLists.txt
index 423ef02..e9229e0 100644
--- a/parser/tests/CMakeLists.txt
+++ b/parser/tests/CMakeLists.txt
@@ -50,6 +50,10 @@
          quickstep_parser_tests_ParserTest
          "${CMAKE_CURRENT_SOURCE_DIR}/Drop.test"
          "${CMAKE_CURRENT_BINARY_DIR}/Drop.test")
+add_test(quickstep_parser_tests_ParserTest_index
+         quickstep_parser_tests_ParserTest
+         "${CMAKE_CURRENT_SOURCE_DIR}/Index.test"
+         "${CMAKE_CURRENT_BINARY_DIR}/Index.test")
 add_test(quickstep_parser_tests_ParserTest_insert
          quickstep_parser_tests_ParserTest
          "${CMAKE_CURRENT_SOURCE_DIR}/Insert.test"
diff --git a/parser/tests/Copy.test b/parser/tests/Copy.test
index 82a1f2f..15db147 100644
--- a/parser/tests/Copy.test
+++ b/parser/tests/Copy.test
@@ -13,43 +13,43 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-copy test from 'test.txt' with ()
+COPY test FROM 'test.txt' WITH ()
 --
 ERROR: syntax error (1 : 33)
-copy test from 'test.txt' with ()
+COPY test FROM 'test.txt' WITH ()
                                 ^
 ==
 
-copy test from 'test.txt'
+COPY test FROM 'test.txt'
 --
 CopyFromStatement[relation_name=test,source_file=test.txt]
 ==
 
-copy test from 'test.txt' with (delimiter 'd', escape_strings false)
+COPY test FROM 'test.txt' WITH (DELIMITER 'd', ESCAPE_STRINGS FALSE)
 --
 CopyFromStatement[relation_name=test,source_file=test.txt]
 +-params=CopyFromParams[delimiter=d,escape_string=false]
 ==
 
-copy test from 'test.txt' with (delimiter '123', escape_strings false)
+COPY test FROM 'test.txt' WITH (DELIMITER '123', ESCAPE_STRINGS FALSE)
 --
 CopyFromStatement[relation_name=test,source_file=test.txt]
 +-params=CopyFromParams[delimiter=123,escape_string=false]
 ==
 
-copy test from 'test.txt' with (delimiter e'\t')
+COPY test FROM 'test.txt' WITH (DELIMITER e'\t')
 --
 CopyFromStatement[relation_name=test,source_file=test.txt]
 +-params=CopyFromParams[delimiter=	,escape_string=true]
 ==
 
-copy test from 'test.txt' with (escape_strings false, delimiter 'd')
+COPY test FROM 'test.txt' WITH (ESCAPE_STRINGS FALSE, DELIMITER 'd')
 --
 CopyFromStatement[relation_name=test,source_file=test.txt]
 +-params=CopyFromParams[delimiter=d,escape_string=false]
 ==
 
-copy test from 'test.txt' with (delimiter '1', escape_strings false, delimiter '2', escape_strings true)
+COPY test FROM 'test.txt' WITH (DELIMITER '1', ESCAPE_STRINGS FALSE, DELIMITER '2', ESCAPE_STRINGS TRUE)
 --
 CopyFromStatement[relation_name=test,source_file=test.txt]
 +-params=CopyFromParams[delimiter=2,escape_string=true]
diff --git a/parser/tests/Create.test b/parser/tests/Create.test
index 3317719..3123039 100644
--- a/parser/tests/Create.test
+++ b/parser/tests/Create.test
@@ -13,22 +13,22 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-create table table (attr int)
+CREATE TABLE TABLE (attr int)
 --
 ERROR: syntax error (1 : 14)
-create table table (attr int)
+CREATE TABLE TABLE (attr int)
              ^
 ==
 
 # We do not allow an empty-column table.
-create table test ()
+CREATE TABLE test ()
 --
 ERROR: syntax error (1 : 20)
-create table test ()
+CREATE TABLE test ()
                    ^
 ==
 
-create table test (attr1 int, attr2 float, attr3 double, attr4 char(5), attr5 varchar(4))
+CREATE TABLE test (attr1 INT, attr2 FLOAT, attr3 DOUBLE, attr4 CHAR(5), attr5 VARCHAR(4))
 --
 CreateTableStatement[relation_name=test]
 +-attribute_list=
@@ -39,36 +39,36 @@
   +-AttributeDefinition[name=attr5,type=VarChar(4)]
 ==
 
-create table test (attr char(-1))
+CREATE TABLE test (attr CHAR(-1))
 --
 ERROR: syntax error (1 : 30)
-create table test (attr char(-1))
+CREATE TABLE test (attr CHAR(-1))
                              ^
 ==
 
 # Zero-length char type is not allowed.
-create table test (attr char(0))
+CREATE TABLE test (attr CHAR(0))
 --
 ERROR: Length for CHAR type must be at least 1 (1 : 30)
-create table test (attr char(0))
+CREATE TABLE test (attr CHAR(0))
                              ^
 ==
 
-create table test(attr char(1+1))
+CREATE TABLE test(attr CHAR(1+1))
 --
 ERROR: syntax error (1 : 30)
-create table test(attr char(1+1))
+CREATE TABLE test(attr CHAR(1+1))
                              ^
 ==
 
-create table test (attr unknown_type)
+CREATE TABLE test (attr UNKNOWN_TYPE)
 --
 ERROR: syntax error (1 : 25)
-create table test (attr unknown_type)
+CREATE TABLE test (attr UNKNOWN_TYPE)
                         ^
 ==
 
-create table test (attr int null, attr float not null)
+CREATE TABLE test (attr INT NULL, attr FLOAT NOT NULL)
 --
 CreateTableStatement[relation_name=test]
 +-attribute_list=
@@ -76,64 +76,64 @@
   +-AttributeDefinition[name=attr,type=Float]
 ==
 
-create table test (attr int unique)
+CREATE TABLE test (attr INT UNIQUE)
 --
 ERROR: Column Constraints (UNIQUE) is not supported yet (1 : 29)
-create table test (attr int unique)
+CREATE TABLE test (attr INT UNIQUE)
                             ^
 ==
 
-create table test (attr int primary key)
+CREATE TABLE test (attr INT PRIMARY KEY)
 --
 ERROR: Column Constraints (PRIMARY KEY) is not supported yet (1 : 29)
-create table test (attr int primary key)
+CREATE TABLE test (attr INT PRIMARY KEY)
                             ^
 ==
 
-create table test (attr int default 4)
+CREATE TABLE test (attr INT DEFAULT 4)
 --
 ERROR: Column Constraints (DEFAULT) is not supported yet (1 : 29)
-create table test (attr int default 4)
+CREATE TABLE test (attr INT DEFAULT 4)
                             ^
 ==
 
-create table test (attr int check(attr>5))
+CREATE TABLE test (attr INT CHECK(attr>5))
 --
 ERROR: Column Constraints (CHECK) is not supported yet (1 : 29)
-create table test (attr int check(attr>5))
+CREATE TABLE test (attr INT CHECK(attr>5))
                             ^
 ==
 
-create table test (attr int references test2(attr2))
+CREATE TABLE test (attr INT REFERENCES test2(attr2))
 --
 ERROR: Foreign Keys is not supported yet (1 : 29)
-create table test (attr int references test2(attr2))
+CREATE TABLE test (attr INT REFERENCES test2(attr2))
                             ^
 ==
 
-create table test (attr int) unique(attr)
+CREATE TABLE test (attr INT) UNIQUE(attr)
 --
 ERROR: Table Constraints (UNIQUE) is not supported yet (1 : 30)
-create table test (attr int) unique(attr)
+CREATE TABLE test (attr INT) UNIQUE(attr)
                              ^
 ==
 
-create table test (attr int) primary key(attr)
+CREATE TABLE test (attr INT) PRIMARY KEY(attr)
 --
 ERROR: Table Constraints (PRIMARY KEY) is not supported yet (1 : 30)
-create table test (attr int) primary key(attr)
+CREATE TABLE test (attr INT) PRIMARY KEY(attr)
                              ^
 ==
 
-create table test (attr int) foreign key(attr)
+CREATE TABLE test (attr INT) FOREIGN KEY(attr)
 --
 ERROR: syntax error (1 : 47)
-... table test (attr int) foreign key(attr)
+... TABLE test (attr INT) FOREIGN KEY(attr)
                                            ^
 ==
 
-create table test (attr int) check(attr>0)
+CREATE TABLE test (attr INT) CHECK(attr>0)
 --
 ERROR: Table Constraints (CHECK) is not supported yet (1 : 30)
-create table test (attr int) check(attr>0)
+CREATE TABLE test (attr INT) CHECK(attr>0)
                              ^
diff --git a/parser/tests/Delete.test b/parser/tests/Delete.test
index 3f31277..e4bc335 100644
--- a/parser/tests/Delete.test
+++ b/parser/tests/Delete.test
@@ -13,7 +13,7 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-delete from test where tb1=1
+DELETE FROM test WHERE tb1=1
 --
 DeleteStatement[relation_name=test]
 +-where_predicate=Equal
@@ -22,27 +22,27 @@
     +-NumericLiteral[numeric_string=1,float_like=false]
 ==
 
-delete from test
+DELETE FROM test
 --
 DeleteStatement[relation_name=test]
 ==
 
-delete from table
+DELETE FROM TABLE
 --
 ERROR: syntax error (1 : 13)
-delete from table
+DELETE FROM TABLE
             ^
 ==
 
-delete from table test
+DELETE FROM TABLE test
 --
 ERROR: syntax error (1 : 13)
-delete from table test
+DELETE FROM TABLE test
             ^
 ==
 
-delete from test1, test2
+DELETE FROM test1, test2
 --
 ERROR: syntax error (1 : 18)
-delete from test1, test2
+DELETE FROM test1, test2
                  ^
diff --git a/parser/tests/Drop.test b/parser/tests/Drop.test
index 9d3f214..eec2a43 100644
--- a/parser/tests/Drop.test
+++ b/parser/tests/Drop.test
@@ -13,13 +13,13 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-drop table test
+DROP TABLE test
 --
 DropTableStatement[relation_name=test]
 ==
 
-drop table table
+DROP TABLE TABLE
 --
 ERROR: syntax error (1 : 12)
-drop table table
+DROP TABLE TABLE
            ^
diff --git a/parser/tests/Index.test b/parser/tests/Index.test
new file mode 100644
index 0000000..b0827ae
--- /dev/null
+++ b/parser/tests/Index.test
@@ -0,0 +1,62 @@
+#   Copyright 2011-2015 Quickstep Technologies LLC.
+#   Copyright 2016 Pivotal Software, Inc.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+
+# Name of index is required
+CREATE INDEX ON test
+--
+ERROR: syntax error (1 : 14)
+CREATE INDEX ON test
+             ^
+==
+
+# Empty-column list is not allowed
+CREATE INDEX test ON test ()
+--
+ERROR: syntax error (1 : 28)
+CREATE INDEX test ON test ()
+                           ^
+==
+
+# Type of index is required
+CREATE INDEX test ON test
+--
+ERROR: syntax error (1 : 26)
+CREATE INDEX test ON test
+                         ^
+==
+
+# Currently supported indexes (bloom_filter)
+CREATE INDEX test ON test USING arbitrary
+--
+ERROR: syntax error (1 : 33)
+CREATE INDEX test ON test USING arbitrary
+                                ^
+==
+
+# Check support for Bloom Filter index
+CREATE INDEX test ON test USING BLOOMFILTER
+--
+ERROR: Bloom Filter Index is not supported yet (1 : 33)
+CREATE INDEX test ON test USING BLOOMFILTER
+                                ^
+==
+
+# Check support for CSB Tree index
+CREATE INDEX test ON test USING CSBTREE
+--
+ERROR: CSB Tree Index is not supported yet (1 : 33)
+CREATE INDEX test ON test USING CSBTREE
+                                ^
+==
diff --git a/parser/tests/Insert.test b/parser/tests/Insert.test
index 05cd383..e74e533 100644
--- a/parser/tests/Insert.test
+++ b/parser/tests/Insert.test
@@ -13,14 +13,14 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-insert into test (attr1, attr2) values (1, 2)
+INSERT INTO test (attr1, attr2) VALUES (1, 2)
 --
 ERROR: list of column names in INSERT statement is not supported yet (1 : 18)
-insert into test (attr1, attr2) values (1, 2)
+INSERT INTO test (attr1, attr2) VALUES (1, 2)
                  ^
 ==
 
-insert into test values (1, -2, 3)
+INSERT INTO test VALUES (1, -2, 3)
 --
 InsertStatement[relation_name=test]
 +-tuple=
@@ -32,14 +32,14 @@
     +-NumericLiteral[numeric_string=3,float_like=false]
 ==
 
-insert into test values (1+1, 2*2, 3+1)
+INSERT INTO test VALUES (1+1, 2*2, 3+1)
 --
 ERROR: syntax error (1 : 27)
-insert into test values (1+1, 2*2, 3+1)
+INSERT INTO test VALUES (1+1, 2*2, 3+1)
                           ^
 ==
 
-insert into test values (e'\'sdfs')
+INSERT INTO test VALUES (e'\'sdfs')
 --
 InsertStatement[relation_name=test]
 +-tuple=
@@ -47,8 +47,8 @@
     +-StringLiteral[value='sdfs]
 ==
 
-insert into test values ('\'sdfs')
+INSERT INTO test VALUES ('\'sdfs')
 --
 ERROR: syntax error (1 : 29)
-insert into test values ('\'sdfs')
+INSERT INTO test VALUES ('\'sdfs')
                             ^
diff --git a/parser/tests/Select.test b/parser/tests/Select.test
index 966d049..8a56f5a 100644
--- a/parser/tests/Select.test
+++ b/parser/tests/Select.test
@@ -13,7 +13,7 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-select * from test
+SELECT * FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -24,70 +24,70 @@
 
 # If the error location is beyond the end of the SQL,
 # we point the error to the place next to the last character.
-select *
+SELECT *
 --
 ERROR: syntax error (1 : 9)
-select *
+SELECT *
         ^
 ==
 
-select *;
+SELECT *;
 --
 ERROR: syntax error (1 : 9)
-select *;
+SELECT *;
         ^
 ==
 
-select $attr from test
+SELECT $attr FROM test
 --
 ERROR: illegal character (1 : 9)
-select $attr from test
+SELECT $attr FROM test
         ^
 ==
 
-select 1 "" from test
+SELECT 1 "" FROM test
 --
 ERROR: Zero-length identifier (1 : 11)
-select 1 "" from test
+SELECT 1 "" FROM test
           ^
 ==
 
-select 1 from test as ""
+SELECT 1 FROM test AS ""
 --
 ERROR: Zero-length identifier (1 : 24)
-select 1 from test as ""
+SELECT 1 FROM test AS ""
                        ^
 ==
 
-select attr from $test
+SELECT attr FROM $test
 --
 ERROR: illegal character (1 : 19)
-select attr from $test
+SELECT attr FROM $test
                   ^
 ==
 
-select from test
+SELECT FROM test
 --
 ERROR: syntax error (1 : 8)
-select from test
+SELECT FROM test
        ^
 ==
 
-select attr1
+SELECT attr1
 --
 ERROR: syntax error (1 : 13)
-select attr1
+SELECT attr1
             ^
 ==
 
-select 1, 2, 3, 4
+SELECT 1, 2, 3, 4
 --
 ERROR: syntax error (1 : 18)
-select 1, 2, 3, 4
+SELECT 1, 2, 3, 4
                  ^
 ==
 
-select 1, 2, 1+1, 1-1, 1-1.2+1-2.3, attr1, attr2, attr1+1, attr1+1*2+attr2, attr1+1*(2+attr2) from test
+SELECT 1, 2, 1+1, 1-1, 1-1.2+1-2.3, attr1, attr2, attr1+1, attr1+1*2+attr2, attr1+1*(2+attr2) FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -155,15 +155,15 @@
     +-TableReference[table=test]
 ==
 
-select * from 123
+SELECT * FROM 123
 --
 ERROR: syntax error (1 : 15)
-select * from 123
+SELECT * FROM 123
               ^
 ==
 
 # Alias
-select 1 as a, 2+1 as b, 3 a, 4 b from test as a, test a
+SELECT 1 AS a, 2+1 AS b, 3 a, 4 b FROM test AS a, test a
 --
 SelectStatement
 +-select_query=Select
@@ -191,7 +191,7 @@
 ==
 
 # Column list aliases in FROM.
-select 1 from test test_alias(attr, attr1, attr2, attr3), (select * from test) as subquery(attr1, attr1, attr4)
+SELECT 1 FROM test test_alias(attr, attr1, attr2, attr3), (SELECT * FROM test) AS subquery(attr1, attr1, attr4)
 --
 SelectStatement
 +-select_query=Select
@@ -214,42 +214,42 @@
 ==
 
 # Table subquery must be named.
-select 1 from (select * from test)
+SELECT 1 FROM (select * FROM test)
 --
 ERROR: syntax error (1 : 35)
-select 1 from (select * from test)
+SELECT 1 FROM (select * FROM test)
                                   ^
 ==
 
-select 1 from test test_alias(attr+1)
+SELECT 1 FROM test test_alias(attr+1)
 --
 ERROR: syntax error (1 : 35)
-select 1 from test test_alias(attr+1)
+SELECT 1 FROM test test_alias(attr+1)
                                   ^
 ==
 
-select 1 from test as
+SELECT 1 FROM test AS
 --
 ERROR: syntax error (1 : 22)
-select 1 from test as
+SELECT 1 FROM test AS
                      ^
 ==
 
-select 1 as a+1 from test
+SELECT 1 AS a+1 FROM test
 --
 ERROR: syntax error (1 : 14)
-select 1 as a+1 from test
+SELECT 1 AS a+1 FROM test
              ^
 ==
 
-select 1 from test as a+1
+SELECT 1 FROM test AS a+1
 --
 ERROR: syntax error (1 : 24)
-select 1 from test as a+1
+SELECT 1 FROM test AS a+1
                        ^
 ==
 
-select 1 from test where 1=1 and attr1=1 and attr+1>=1 and attr-1<=1 and attr+1>1 and attr-1<1
+SELECT 1 FROM test WHERE 1=1 AND attr1=1 AND attr+1>=1 AND attr-1<=1 AND attr+1>1 AND attr-1<1
 --
 SelectStatement
 +-select_query=Select
@@ -299,7 +299,7 @@
     +-TableReference[table=test]
 ==
 
-select 1 from test where attr between 1 and 2 and attr between 2 and 1
+SELECT 1 FROM test WHERE attr BETWEEN 1 AND 2 AND attr BETWEEN 2 AND 1
 --
 SelectStatement
 +-select_query=Select
@@ -324,7 +324,7 @@
     +-TableReference[table=test]
 ==
 
-select 1 from test where attr not between 1 and 2
+SELECT 1 FROM test WHERE attr NOT BETWEEN 1 AND 2
 --
 SelectStatement
 +-select_query=Select
@@ -343,7 +343,7 @@
     +-TableReference[table=test]
 ==
 
-select 1 from test order by attr, 1
+SELECT 1 FROM test ORDER BY attr, 1
 --
 SelectStatement
 +-select_query=Select
@@ -361,7 +361,7 @@
     +-TableReference[table=test]
 ==
 
-select fun(attr)+1 from test group by fun()+fun(attr), attr1+attr2 having attr1>1 and fun(*)>1
+SELECT fun(attr)+1 FROM test GROUP BY fun()+fun(attr), attr1+attr2 HAVING attr1>1 AND fun(*)>1
 --
 SelectStatement
 +-select_query=Select
@@ -395,11 +395,11 @@
 ==
 
 # ORDER BY
-select 1 from test order by 1 asc,
-                            2 desc,
-                            3 asc nulls first,
-                            attr1 desc nulls last,
-                            attr1+1 nulls first,
+SELECT 1 FROM test ORDER BY 1 ASC,
+                            2 DESC,
+                            3 ASC NULLS FIRST,
+                            attr1 DESC NULLS LAST,
+                            attr1+1 NULLS FIRST,
                             fun(attr)/2
 --
 SelectStatement
@@ -436,7 +436,7 @@
 ==
 
 # Limit
-select 1 from test limit 1
+SELECT 1 FROM test LIMIT 1
 --
 SelectStatement
 +-select_query=Select
@@ -450,31 +450,31 @@
     +-TableReference[table=test]
 ==
 
-select 1 from test limit 1.1
+SELECT 1 FROM test LIMIT 1.1
 --
 ERROR: LIMIT value must be an integer (1 : 26)
-select 1 from test limit 1.1
+SELECT 1 FROM test LIMIT 1.1
                          ^
 ==
 
-select 1 from test limit 0
+SELECT 1 FROM test LIMIT 0
 --
 ERROR: LIMIT value must be positive (1 : 26)
-select 1 from test limit 0
+SELECT 1 FROM test LIMIT 0
                          ^
 ==
 
-select 1 from test limit -1
+SELECT 1 FROM test LIMIT -1
 --
 ERROR: syntax error (1 : 26)
-select 1 from test limit -1
+SELECT 1 FROM test LIMIT -1
                          ^
 ==
 
-select 1 from test limit abc
+SELECT 1 FROM test LIMIT abc
 --
 ERROR: syntax error (1 : 26)
-select 1 from test limit abc
+SELECT 1 FROM test LIMIT abc
                          ^
 ==
 
@@ -483,7 +483,7 @@
 #
 
 # Subqueries in the FROM clause.
-select * from test, (select * from test) as a, (select * from test) a
+SELECT * FROM test, (select * FROM test) AS a, (select * FROM test) a
 --
 SelectStatement
 +-select_query=Select
@@ -506,14 +506,14 @@
             +-TableReference[table=test]
 ==
 
-select * from test, select * from test
+SELECT * FROM test, SELECT * FROM test
 --
 ERROR: syntax error (1 : 21)
-select * from test, select * from test
+SELECT * FROM test, SELECT * FROM test
                     ^
 ==
 
-select * from (select * from (select * from (select * from test) a ) a ) a
+SELECT * FROM (select * FROM (select * FROM (select * FROM test) a ) a ) a
 --
 SelectStatement
 +-select_query=Select
@@ -541,27 +541,27 @@
 ==
 
 # Subqueries are not supported yet in clauses other than the FROM clause.
-select (select * from test) from test
+SELECT (select * FROM test) FROM test
 --
 ERROR: syntax error (1 : 9)
-select (select * from test) from test
+SELECT (select * FROM test) FROM test
         ^
 ==
 
-select 1 from test where 1 > (select 1 from test)
+SELECT 1 FROM test WHERE 1 > (select 1 FROM test)
 --
 ERROR: syntax error (1 : 31)
-select 1 from test where 1 > (select 1 from test)
+SELECT 1 FROM test WHERE 1 > (select 1 FROM test)
                               ^
 ==
 
 #
 # WITH clause
 #
-with a (col) as (select 1 from test group by a order by b limit 1),
-     b (col1, col2, col3) as (select * from (select * from test) a),
-     c as (select 1 from test)
-select 1 from a, b, c, d
+WITH a (col) AS (SELECT 1 FROM test GROUP BY a ORDER BY b LIMIT 1),
+     b (col1, col2, col3) AS (SELECT * FROM (SELECT * FROM test) a),
+     c AS (SELECT 1 FROM test)
+SELECT 1 FROM a, b, c, d
 --
 SelectStatement
 +-select_query=Select
@@ -617,8 +617,8 @@
           +-TableReference[table=test]
 ==
 
-with a as (select 1 from test)
-select 1 from a
+WITH a AS (SELECT 1 FROM test)
+SELECT 1 FROM a
 --
 SelectStatement
 +-select_query=Select
@@ -642,44 +642,44 @@
 ==
 
 # AS cannot be omitted.
-with a (select 1 from test)
-select 1 from a
+WITH a (SELECT 1 FROM test)
+SELECT 1 FROM a
 --
 ERROR: syntax error (1 : 9)
-with a (select 1 from test)
+WITH a (SELECT 1 FROM test)
         ^
 ==
 
-with a as (select 1 from test)
+WITH a AS (SELECT 1 FROM test)
 --
 ERROR: syntax error (1 : 31)
-with a as (select 1 from test)
+WITH a AS (SELECT 1 FROM test)
                               ^
 ==
 
 # The WITH query cannot have WITH.
-with a as (with c select 1 from test)
-select 1 from test
+WITH a AS (with c SELECT 1 FROM test)
+SELECT 1 FROM test
 --
 ERROR: syntax error (1 : 12)
-with a as (with c select 1 from test)
+WITH a AS (with c SELECT 1 FROM test)
            ^
 ==
 
-with a as (select 1 from test) b
-select 1 from test
+WITH a AS (select 1 FROM test) b
+SELECT 1 FROM test
 --
 ERROR: syntax error (1 : 32)
-with a as (select 1 from test) b
+WITH a AS (select 1 FROM test) b
                                ^
 ==
 
 # Missing comma.
-select a as (select 1 from test) b as (select 1 from test)
-select 1 from test
+SELECT a AS (select 1 FROM test) b AS (SELECT 1 FROM test)
+SELECT 1 FROM test
 --
 ERROR: syntax error (1 : 13)
-select a as (select 1 from test) b as (selec...
+SELECT a AS (select 1 FROM test) b AS (SELEC...
             ^
 ==
 
@@ -688,22 +688,22 @@
 #
 
 # Bool literal value is not supported yet.
-select 1 from test where true
+SELECT 1 FROM test WHERE TRUE
 --
 ERROR: syntax error (1 : 26)
-select 1 from test where true
+SELECT 1 FROM test WHERE TRUE
                          ^
 ==
 
-select 1 from test where tb1 = true
+SELECT 1 FROM test WHERE tb1 = TRUE
 --
 ERROR: syntax error (1 : 32)
-select 1 from test where tb1 = true
+SELECT 1 FROM test WHERE tb1 = TRUE
                                ^
 ==
 
 # FIXME(chasseur, qzeng): The result is wrong. Add support for hexadecimal literals.
-select 0xfff from test
+SELECT 0xfff FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -715,16 +715,16 @@
     +-TableReference[table=test]
 ==
 
-select x'fff' from test
+SELECT x'fff' FROM test
 --
 ERROR: syntax error (1 : 13)
-select x'fff' from test
+SELECT x'fff' FROM test
             ^
 ==
 
-select 123e23, 123e-123, 123e-2+1, 123e-2*2, 123e-123,
+SELECT 123e23, 123e-123, 123e-2+1, 123e-2*2, 123e-123,
        1e100000000
-from test
+FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -757,10 +757,10 @@
     +-TableReference[table=test]
 ==
 
-select 9223372036854775805, 9223372036854775807, 9223372036854775809, -9223372036854775805,
+SELECT 9223372036854775805, 9223372036854775807, 9223372036854775809, -9223372036854775805,
        -9223372036854775807, -9223372036854775809, 9223372036854775800.8, 1.123456789012345678901234567890,
        -9223372036854775800.8, -1.123456789012345678901234567890
-from test
+FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -802,7 +802,7 @@
 ==
 
 # Escape characters.
-select 1, e'$asdfg\'\'\"\"\t\r\n' from test where char_col = e'\'asdfg\''
+SELECT 1, e'$asdfg\'\'\"\"\t\r\n' FROM test WHERE char_col = e'\'asdfg\''
 --
 SelectStatement
 +-select_query=Select
@@ -823,7 +823,7 @@
 ==
 
 # Double-quoted strings are identifiers, which do not need to be escaped.
-select 1 "abc\n" from test
+SELECT 1 "abc\n" FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -835,10 +835,10 @@
     +-TableReference[table=test]
 ==
 
-select 1 "abc
+SELECT 1 "abc
 
 def
-" from test
+" FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -854,22 +854,22 @@
 ==
 
 # Currently predicate is not treated as a regular scalar expression.
-select 1 from test where (1>1)=(1<1)
+SELECT 1 FROM test WHERE (1>1)=(1<1)
 --
 ERROR: syntax error (1 : 31)
-select 1 from test where (1>1)=(1<1)
+SELECT 1 FROM test WHERE (1>1)=(1<1)
                               ^
 ==
 
-select 1 """this is a double-quoted string""", 2 "this is not a double-quoted string" from test
+SELECT 1 """this IS a double-quoted string""", 2 "this IS NOT a double-quoted string" FROM test
 --
 SelectStatement
 +-select_query=Select
   +-select_clause=SelectList
-  | +-SelectListItem[alias="this is a double-quoted string"]
+  | +-SelectListItem[alias="this IS a double-quoted string"]
   | | +-Literal
   | |   +-NumericLiteral[numeric_string=1,float_like=false]
-  | +-SelectListItem[alias=this is not a double-quoted string]
+  | +-SelectListItem[alias=this IS NOT a double-quoted string]
   |   +-Literal
   |     +-NumericLiteral[numeric_string=2,float_like=false]
   +-from_clause=
@@ -880,9 +880,9 @@
 # DateTime and Interval
 #
 
-select '1998-12-01',
-       date '1998-12-01'
-from test
+SELECT '1998-12-01',
+       DATE '1998-12-01'
+FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -898,8 +898,8 @@
 ==
 
 # Year before 1970.
-select date '1960-12-12',
-       date '1901-12-14' from test
+SELECT DATE '1960-12-12',
+       DATE '1901-12-14' FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -914,7 +914,7 @@
     +-TableReference[table=test]
 ==
 
-select date '1998-2-12', date '1998-12-2' from test
+SELECT DATE '1998-2-12', DATE '1998-12-2' FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -929,9 +929,9 @@
     +-TableReference[table=test]
 ==
 
-select date '+1921-12-12',
-       date '+10001-12-12'
-from test
+SELECT DATE '+1921-12-12',
+       DATE '+10001-12-12'
+FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -946,44 +946,44 @@
     +-TableReference[table=test]
 ==
 
-select date 'a1998-12-12' from test
+SELECT DATE 'a1998-12-12' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 25)
-select date 'a1998-12-12' from test
+SELECT DATE 'a1998-12-12' FROM test
                         ^
 ==
 
-select date '1998-a12-b12' from test
+SELECT DATE '1998-a12-b12' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 26)
-select date '1998-a12-b12' from test
+SELECT DATE '1998-a12-b12' FROM test
                          ^
 ==
 
-select date '1998-+12-12' from test
+SELECT DATE '1998-+12-12' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 25)
-select date '1998-+12-12' from test
+SELECT DATE '1998-+12-12' FROM test
                         ^
 ==
 
-select date '1998-12-12abc' from test
+SELECT DATE '1998-12-12abc' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 27)
-select date '1998-12-12abc' from test
+SELECT DATE '1998-12-12abc' FROM test
                           ^
 ==
 
-select date '1998/12/12' from test
+SELECT DATE '1998/12/12' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 24)
-select date '1998/12/12' from test
+SELECT DATE '1998/12/12' FROM test
                        ^
 ==
 
-select date '1996-02-29',
-       date '1997-03-31',
-       date '1998-04-30' from test
+SELECT DATE '1996-02-29',
+       DATE '1997-03-31',
+       DATE '1998-04-30' FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1001,17 +1001,17 @@
     +-TableReference[table=test]
 ==
 
-select date '1999-02-29' from test
+SELECT DATE '1999-02-29' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 24)
-select date '1999-02-29' from test
+SELECT DATE '1999-02-29' FROM test
                        ^
 ==
 
 # Quickstep accepts time in the DATE type.
-select date '2007-05-08 12:35:29',
-       date '2007-05-08 12:35:29.010'
-from test
+SELECT DATE '2007-05-08 12:35:29',
+       DATE '2007-05-08 12:35:29.010'
+FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1026,14 +1026,14 @@
     +-TableReference[table=test]
 ==
 
-select date '1999-04-31' from test
+SELECT DATE '1999-04-31' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 24)
-select date '1999-04-31' from test
+SELECT DATE '1999-04-31' FROM test
                        ^
 ==
 
-select 1 from test where attr_date <= date '1998-12-01' - interval '96 day'
+SELECT 1 FROM test WHERE attr_date <= DATE '1998-12-01' - INTERVAL '96 day'
 --
 SelectStatement
 +-select_query=Select
@@ -1052,17 +1052,17 @@
     +-TableReference[table=test]
 ==
 
-select interval '1 us', interval '1 ms', interval '1 s', interval '1 minute',
-           interval '1 h', interval '1 day', interval '1 week',
-           interval '1 month', interval '1 year', interval '1 decade',
-           interval '1 century', interval '1 millennium',
-       datetime interval '1 us', datetime interval '1 ms',
-           datetime interval '1 s', datetime interval '1 minute',
-           datetime interval '1 h', datetime interval '1 day',
-           datetime interval '1 week', yearmonth interval '1 month',
-           yearmonth interval '1 year', yearmonth interval '1 decade',
-           yearmonth interval '1 century', yearmonth interval '1 millennium'
-from test
+SELECT INTERVAL '1 us', INTERVAL '1 ms', INTERVAL '1 s', INTERVAL '1 minute',
+           INTERVAL '1 h', INTERVAL '1 day', INTERVAL '1 week',
+           INTERVAL '1 month', INTERVAL '1 year', INTERVAL '1 decade',
+           INTERVAL '1 century', INTERVAL '1 millennium',
+       DATETIME INTERVAL '1 us', DATETIME INTERVAL '1 ms',
+           DATETIME INTERVAL '1 s', DATETIME INTERVAL '1 minute',
+           DATETIME INTERVAL '1 h', DATETIME INTERVAL '1 day',
+           DATETIME INTERVAL '1 week', YEARMONTH INTERVAL '1 month',
+           YEARMONTH INTERVAL '1 year', YEARMONTH INTERVAL '1 decade',
+           YEARMONTH INTERVAL '1 century', YEARMONTH INTERVAL '1 millennium'
+FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1143,22 +1143,22 @@
     +-TableReference[table=test]
 ==
 
-select interval '4 day' (1)
-from test
+SELECT INTERVAL '4 day' (1)
+FROM test
 --
 ERROR: syntax error (1 : 25)
-select interval '4 day' (1)
+SELECT INTERVAL '4 day' (1)
                         ^
 ==
 
-select interval '2 moth' from test
+SELECT INTERVAL '2 moth' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 24)
-select interval '2 moth' from test
+SELECT INTERVAL '2 moth' FROM test
                        ^
 ==
 
-select interval '-3 year' from test
+SELECT INTERVAL '-3 year' FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1170,24 +1170,24 @@
     +-TableReference[table=test]
 ==
 
-select interval 'a 3 year' from test
+SELECT INTERVAL 'a 3 year' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 26)
-select interval 'a 3 year' from test
+SELECT INTERVAL 'a 3 year' FROM test
                          ^
 ==
 
-select interval '5-3 year to month' from test
+SELECT INTERVAL '5-3 year to month' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 35)
-select interval '5-3 year to month' from test
+SELECT INTERVAL '5-3 year to month' FROM test
                                   ^
 ==
 
-select interval '5-3 day to second' from test
+SELECT INTERVAL '5-3 day to second' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 35)
-select interval '5-3 day to second' from test
+SELECT INTERVAL '5-3 day to second' FROM test
                                   ^
 ==
 
@@ -1196,7 +1196,7 @@
 # or negation operation, not as the notation of a negative value.
 #
 
-select 1-1  from test
+SELECT 1-1 FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1211,19 +1211,19 @@
     +-TableReference[table=test]
 ==
 
-select 1 - 1 from test
+SELECT 1 - 1 FROM test
 --
 [same as above]
 ==
 
-select 1--1 from test
+SELECT 1--1 FROM test
 --
 ERROR: syntax error (1 : 22)
-select 1--1 from test
+SELECT 1--1 FROM test
                      ^
 ==
 
-select 1+-1 from test
+SELECT 1+-1 FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1238,7 +1238,7 @@
     +-TableReference[table=test]
 ==
 
-select 1-1+-1 from test
+SELECT 1-1+-1 FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1256,7 +1256,7 @@
     +-TableReference[table=test]
 ==
 
-select 1+(-1) from test
+SELECT 1+(-1) FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1272,13 +1272,13 @@
 ==
 
 # Quit statement
-quit
+QUIT
 --
 QuitStatement
 ==
 
 # Literals with various explicit types.
-select int '1', long '1', float '1', double '1', char(42) 'foo', varchar(42) 'bar' from test
+SELECT INT '1', LONG '1', FLOAT '1', DOUBLE '1', char(42) 'foo', varchar(42) 'bar' FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1306,24 +1306,24 @@
 ==
 
 # Value needs to be quoted when giving an explicit type.
-select int 1 from test
+SELECT INT 1 FROM test
 --
 ERROR: syntax error (1 : 12)
-select int 1 from test
+SELECT INT 1 FROM test
            ^
 ==
 
 # Explicit type that can't parse the supplied string.
-select int 'foo' from test
+SELECT INT 'foo' FROM test
 --
 ERROR: Failed to parse literal as specified type (1 : 16)
-select int 'foo' from test
+SELECT INT 'foo' FROM test
                ^
 ==
 
 # Various floats that, while not in the canonical print format, are still
 # acceptable according to the SQL standard.
-select 1. from test
+SELECT 1. FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1335,7 +1335,7 @@
     +-TableReference[table=test]
 ==
 
-select .1 from test
+SELECT .1 FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1347,7 +1347,7 @@
     +-TableReference[table=test]
 ==
 
-select 1.e1 from test
+SELECT 1.e1 FROM test
 --
 SelectStatement
 +-select_query=Select
@@ -1359,7 +1359,7 @@
     +-TableReference[table=test]
 ==
 
-select .1e1 from test
+SELECT .1e1 FROM test
 --
 SelectStatement
 +-select_query=Select
diff --git a/parser/tests/TPCH.test b/parser/tests/TPCH.test
index 2079e65..54c021a 100644
--- a/parser/tests/TPCH.test
+++ b/parser/tests/TPCH.test
@@ -14,27 +14,27 @@
 #   limitations under the License.
 
 # Query 1
-select
-	l_returnflag,
-	l_linestatus,
-	sum(l_quantity) as sum_qty,
-	sum(l_extendedprice) as sum_base_price,
-	sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
-	sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
-	avg(l_quantity) as avg_qty,
-	avg(l_extendedprice) as avg_price,
-	avg(l_discount) as avg_disc,
-	count(*) as count_order
-from
-	lineitem
-where
-	l_shipdate <= date '1998-12-01' - interval '96 day'
-group by
-	l_returnflag,
-	l_linestatus
-order by
-	l_returnflag,
-	l_linestatus
+SELECT
+  l_returnflag,
+  l_linestatus,
+  SUM(l_quantity) AS sum_qty,
+  SUM(l_extendedprice) AS sum_base_price,
+  SUM(l_extendedprice * (1 - l_discount)) AS sum_disc_price,
+  SUM(l_extendedprice * (1 - l_discount) * (1 + l_tax)) AS sum_charge,
+  AVG(l_quantity) AS avg_qty,
+  AVG(l_extendedprice) AS avg_price,
+  AVG(l_discount) AS avg_disc,
+  COUNT(*) AS count_order
+FROM
+  lineitem
+WHERE
+  l_shipdate <= DATE '1998-12-01' - INTERVAL '96 day'
+GROUP BY
+  l_returnflag,
+  l_linestatus
+ORDER BY
+  l_returnflag,
+  l_linestatus
 --
 SelectStatement
 +-select_query=Select
@@ -44,13 +44,13 @@
   | +-SelectListItem
   | | +-AttributeReference[attribute_name=l_linestatus]
   | +-SelectListItem[alias=sum_qty]
-  | | +-FunctionCall[name=sum]
+  | | +-FunctionCall[name=SUM]
   | |   +-AttributeReference[attribute_name=l_quantity]
   | +-SelectListItem[alias=sum_base_price]
-  | | +-FunctionCall[name=sum]
+  | | +-FunctionCall[name=SUM]
   | |   +-AttributeReference[attribute_name=l_extendedprice]
   | +-SelectListItem[alias=sum_disc_price]
-  | | +-FunctionCall[name=sum]
+  | | +-FunctionCall[name=SUM]
   | |   +-Multiply
   | |     +-left_operand=AttributeReference[attribute_name=l_extendedprice]
   | |     +-right_operand=Subtract
@@ -58,7 +58,7 @@
   | |       | +-NumericLiteral[numeric_string=1,float_like=false]
   | |       +-right_operand=AttributeReference[attribute_name=l_discount]
   | +-SelectListItem[alias=sum_charge]
-  | | +-FunctionCall[name=sum]
+  | | +-FunctionCall[name=SUM]
   | |   +-Multiply
   | |     +-left_operand=Multiply
   | |     | +-left_operand=AttributeReference[attribute_name=l_extendedprice]
@@ -71,16 +71,16 @@
   | |       | +-NumericLiteral[numeric_string=1,float_like=false]
   | |       +-right_operand=AttributeReference[attribute_name=l_tax]
   | +-SelectListItem[alias=avg_qty]
-  | | +-FunctionCall[name=avg]
+  | | +-FunctionCall[name=AVG]
   | |   +-AttributeReference[attribute_name=l_quantity]
   | +-SelectListItem[alias=avg_price]
-  | | +-FunctionCall[name=avg]
+  | | +-FunctionCall[name=AVG]
   | |   +-AttributeReference[attribute_name=l_extendedprice]
   | +-SelectListItem[alias=avg_disc]
-  | | +-FunctionCall[name=avg]
+  | | +-FunctionCall[name=AVG]
   | |   +-AttributeReference[attribute_name=l_discount]
   | +-SelectListItem[alias=count_order]
-  |   +-FunctionCall[name=count,is_star=true]
+  |   +-FunctionCall[name=COUNT,is_star=true]
   +-where_clause=LessOrEqual
   | +-left_operand=AttributeReference[attribute_name=l_shipdate]
   | +-right_operand=Subtract
@@ -101,80 +101,80 @@
 ==
 
 # Query 2
-select
-	s_acctbal,
-	s_name,
-	n_name,
-	p_partkey,
-	p_mfgr,
-	s_address,
-	s_phone,
-	s_comment
-from
-	part,
-	supplier,
-	partsupp,
-	nation,
-	region
-where
-	p_partkey = ps_partkey
-	and s_suppkey = ps_suppkey
-	and p_size = 48
-	and p_type like '%NICKEL'
-	and s_nationkey = n_nationkey
-	and n_regionkey = r_regionkey
-	and r_name = 'ASIA'
-	and ps_supplycost = (
-		select
-			min(ps_supplycost)
-		from
-			partsupp,
-			supplier,
-			nation,
-			region
-		where
-			p_partkey = ps_partkey
-			and s_suppkey = ps_suppkey
-			and s_nationkey = n_nationkey
-			and n_regionkey = r_regionkey
-			and r_name = 'ASIA'
-	)
-order by
-	s_acctbal desc,
-	n_name,
-	s_name,
-	p_partkey
-limit 100
+SELECT
+  s_acctbal,
+  s_name,
+  n_name,
+  p_partkey,
+  p_mfgr,
+  s_address,
+  s_phone,
+  s_comment
+FROM
+  part,
+  supplier,
+  partsupp,
+  nation,
+  region
+WHERE
+  p_partkey = ps_partkey
+  AND s_suppkey = ps_suppkey
+  AND p_size = 48
+  AND p_type LIKE '%NICKEL'
+  AND s_nationkey = n_nationkey
+  AND n_regionkey = r_regionkey
+  AND r_name = 'ASIA'
+  AND ps_supplycost = (
+    SELECT
+      MIN(ps_supplycost)
+    FROM
+      partsupp,
+      supplier,
+      nation,
+      region
+    WHERE
+      p_partkey = ps_partkey
+      AND s_suppkey = ps_suppkey
+      AND s_nationkey = n_nationkey
+      AND n_regionkey = r_regionkey
+      AND r_name = 'ASIA'
+  )
+ORDER BY
+  s_acctbal desc,
+  n_name,
+  s_name,
+  p_partkey
+LIMIT 100
 --
-ERROR: LIKE predicates is not supported yet (20 : 13)
-	and p_type like '%NICKEL'
-	           ^
+ERROR: LIKE predicates is not supported yet (20 : 14)
+  AND p_type LIKE '%NICKEL'
+             ^
 ==
 
 # Query 3
-select
-	l_orderkey,
-	sum(l_extendedprice * (1 - l_discount)) as revenue,
-	o_orderdate,
-	o_shippriority
-from
-	customer,
-	orders,
-	lineitem
-where
-	c_mktsegment = 'AUTOMOBILE'
-	and c_custkey = o_custkey
-	and l_orderkey = o_orderkey
-	and o_orderdate < date '1995-03-17'
-	and l_shipdate > date '1995-03-17'
-group by
-	l_orderkey,
-	o_orderdate,
-	o_shippriority
-order by
-	revenue desc,
-	o_orderdate
-limit 10
+SELECT
+  l_orderkey,
+  SUM(l_extendedprice * (1 - l_discount)) AS revenue,
+  o_orderdate,
+  o_shippriority
+FROM
+  customer,
+  orders,
+  lineitem
+WHERE
+  c_mktsegment = 'AUTOMOBILE'
+  AND c_custkey = o_custkey
+  AND l_orderkey = o_orderkey
+  AND o_orderdate < DATE '1995-03-17'
+  AND l_shipdate > DATE '1995-03-17'
+GROUP BY
+  l_orderkey,
+  o_orderdate,
+  o_shippriority
+ORDER BY
+  revenue desc,
+  o_orderdate
+LIMIT 10
 --
 SelectStatement
 +-select_query=Select
@@ -182,7 +182,7 @@
   | +-SelectListItem
   | | +-AttributeReference[attribute_name=l_orderkey]
   | +-SelectListItem[alias=revenue]
-  | | +-FunctionCall[name=sum]
+  | | +-FunctionCall[name=SUM]
   | |   +-Multiply
   | |     +-left_operand=AttributeReference[attribute_name=l_extendedprice]
   | |     +-right_operand=Subtract
@@ -230,58 +230,58 @@
 ==
 
 # Query 4
-select
-	o_orderpriority,
-	count(*) as order_count
-from
-	orders
-where
-	o_orderdate >= date '1995-08-01'
-	and o_orderdate < date '1995-08-01' + interval '3 month'
-	and exists (
-		select
-			*
-		from
-			lineitem
-		where
-			l_orderkey = o_orderkey
-			and l_commitdate < l_receiptdate
-	)
-group by
-	o_orderpriority
-order by
-	o_orderpriority
+SELECT
+  o_orderpriority,
+  COUNT(*) AS order_count
+FROM
+  orders
+WHERE
+  o_orderdate >= DATE '1995-08-01'
+  AND o_orderdate < DATE '1995-08-01' + INTERVAL '3 month'
+  AND EXISTS (
+    SELECT
+      *
+    FROM
+      lineitem
+    WHERE
+      l_orderkey = o_orderkey
+      AND l_commitdate < l_receiptdate
+  )
+GROUP BY
+  o_orderpriority
+ORDER BY
+  o_orderpriority
 --
-ERROR: syntax error (10 : 3)
-		select
-		^
+ERROR: syntax error (10 : 5)
+    SELECT
+    ^
 ==
 
 # Query 5
-select
-	n_name,
-	sum(l_extendedprice * (1 - l_discount)) as revenue
-from
-	customer,
-	orders,
-	lineitem,
-	supplier,
-	nation,
-	region
-where
-	c_custkey = o_custkey
-	and l_orderkey = o_orderkey
-	and l_suppkey = s_suppkey
-	and c_nationkey = s_nationkey
-	and s_nationkey = n_nationkey
-	and n_regionkey = r_regionkey
-	and r_name = 'AMERICA'
-	and o_orderdate >= date '1997-01-01'
-	and o_orderdate < date '1997-01-01' + interval '1 year'
-group by
-	n_name
-order by
-	revenue desc
+SELECT
+  n_name,
+  SUM(l_extendedprice * (1 - l_discount)) AS revenue
+FROM
+  customer,
+  orders,
+  lineitem,
+  supplier,
+  nation,
+  region
+WHERE
+  c_custkey = o_custkey
+  AND l_orderkey = o_orderkey
+  AND l_suppkey = s_suppkey
+  AND c_nationkey = s_nationkey
+  AND s_nationkey = n_nationkey
+  AND n_regionkey = r_regionkey
+  AND r_name = 'AMERICA'
+  AND o_orderdate >= DATE '1997-01-01'
+  AND o_orderdate < DATE '1997-01-01' + INTERVAL '1 year'
+GROUP BY
+  n_name
+ORDER BY
+  revenue DESC
 --
 SelectStatement
 +-select_query=Select
@@ -289,7 +289,7 @@
   | +-SelectListItem
   | | +-AttributeReference[attribute_name=n_name]
   | +-SelectListItem[alias=revenue]
-  |   +-FunctionCall[name=sum]
+  |   +-FunctionCall[name=SUM]
   |     +-Multiply
   |       +-left_operand=AttributeReference[attribute_name=l_extendedprice]
   |       +-right_operand=Subtract
@@ -345,21 +345,21 @@
 ==
 
 # Query 6
-select
-	sum(l_extendedprice * l_discount) as revenue
-from
-	lineitem
-where
-	l_shipdate >= date '1997-01-01'
-	and l_shipdate < date '1997-01-01' + interval '1 year'
-	and l_discount between 0.03 - 0.01 and 0.03 + 0.01
-	and l_quantity < 25
+SELECT
+  SUM(l_extendedprice * l_discount) AS revenue
+FROM
+  lineitem
+WHERE
+  l_shipdate >= DATE '1997-01-01'
+  AND l_shipdate < DATE '1997-01-01' + INTERVAL '1 year'
+  AND l_discount BETWEEN 0.03 - 0.01 AND 0.03 + 0.01
+  AND l_quantity < 25
 --
 SelectStatement
 +-select_query=Select
   +-select_clause=SelectList
   | +-SelectListItem[alias=revenue]
-  |   +-FunctionCall[name=sum]
+  |   +-FunctionCall[name=SUM]
   |     +-Multiply
   |       +-left_operand=AttributeReference[attribute_name=l_extendedprice]
   |       +-right_operand=AttributeReference[attribute_name=l_discount]
@@ -396,167 +396,167 @@
 ==
 
 # Query 7
-select
-	supp_nation,
-	cust_nation,
-	l_year,
-	sum(volume) as revenue
-from
-	(
-		select
-			n1.n_name as supp_nation,
-			n2.n_name as cust_nation,
-			extract(year from l_shipdate) as l_year,
-			l_extendedprice * (1 - l_discount) as volume
-		from
-			supplier,
-			lineitem,
-			orders,
-			customer,
-			nation n1,
-			nation n2
-		where
-			s_suppkey = l_suppkey
-			and o_orderkey = l_orderkey
-			and c_custkey = o_custkey
-			and s_nationkey = n1.n_nationkey
-			and c_nationkey = n2.n_nationkey
-			and (
-				(n1.n_name = 'ETHIOPIA' and n2.n_name = 'UNITED STATES')
-				or (n1.n_name = 'UNITED STATES' and n2.n_name = 'ETHIOPIA')
-			)
-			and l_shipdate between date '1995-01-01' and date '1996-12-31'
-	) as shipping
-group by
-	supp_nation,
-	cust_nation,
-	l_year
-order by
-	supp_nation,
-	cust_nation,
-	l_year
+SELECT
+  supp_nation,
+  cust_nation,
+  l_year,
+  SUM(volume) AS revenue
+FROM
+  (
+    SELECT
+      n1.n_name AS supp_nation,
+      n2.n_name AS cust_nation,
+      EXTRACT(year FROM l_shipdate) AS l_year,
+      l_extendedprice * (1 - l_discount) AS volume
+    FROM
+      supplier,
+      lineitem,
+      orders,
+      customer,
+      nation n1,
+      nation n2
+    WHERE
+      s_suppkey = l_suppkey
+      AND o_orderkey = l_orderkey
+      AND c_custkey = o_custkey
+      AND s_nationkey = n1.n_nationkey
+      AND c_nationkey = n2.n_nationkey
+      AND (
+        (n1.n_name = 'ETHIOPIA' AND n2.n_name = 'UNITED STATES')
+        OR (n1.n_name = 'UNITED STATES' AND n2.n_name = 'ETHIOPIA')
+      )
+      AND l_shipdate BETWEEN DATE '1995-01-01' AND DATE '1996-12-31'
+  ) AS shipping
+GROUP BY
+  supp_nation,
+  cust_nation,
+  l_year
+ORDER BY
+  supp_nation,
+  cust_nation,
+  l_year
 --
-ERROR: syntax error (11 : 17)
-			extract(year from l_shipdate) as l_year,
-			             ^
+ERROR: syntax error (11 : 20)
+      EXTRACT(year FROM l_shipdate) AS l_year,
+                   ^
 ==
 
 # Query 8
-select
-	o_year,
-	sum(case
-		when nation = 'UNITED STATES' then volume
-		else 0
-	end) / sum(volume) as mkt_share
-from
-	(
-		select
-			extract(year from o_orderdate) as o_year,
-			l_extendedprice * (1 - l_discount) as volume,
-			n2.n_name as nation
-		from
-			part,
-			supplier,
-			lineitem,
-			orders,
-			customer,
-			nation n1,
-			nation n2,
-			region
-		where
-			p_partkey = l_partkey
-			and s_suppkey = l_suppkey
-			and l_orderkey = o_orderkey
-			and o_custkey = c_custkey
-			and c_nationkey = n1.n_nationkey
-			and n1.n_regionkey = r_regionkey
-			and r_name = 'AMERICA'
-			and s_nationkey = n2.n_nationkey
-			and o_orderdate between date '1995-01-01' and date '1996-12-31'
-			and p_type = 'MEDIUM ANODIZED NICKEL'
-	) as all_nations
-group by
-	o_year
-order by
-	o_year
+SELECT
+  o_year,
+  SUM(case
+    when nation = 'UNITED STATES' then volume
+    else 0
+  end) / SUM(volume) AS mkt_share
+FROM
+  (
+    SELECT
+      EXTRACT(year FROM o_orderdate) AS o_year,
+      l_extendedprice * (1 - l_discount) AS volume,
+      n2.n_name AS nation
+    FROM
+      part,
+      supplier,
+      lineitem,
+      orders,
+      customer,
+      nation n1,
+      nation n2,
+      region
+    WHERE
+      p_partkey = l_partkey
+      AND s_suppkey = l_suppkey
+      AND l_orderkey = o_orderkey
+      AND o_custkey = c_custkey
+      AND c_nationkey = n1.n_nationkey
+      AND n1.n_regionkey = r_regionkey
+      AND r_name = 'AMERICA'
+      AND s_nationkey = n2.n_nationkey
+      AND o_orderdate BETWEEN DATE '1995-01-01' AND DATE '1996-12-31'
+      AND p_type = 'MEDIUM ANODIZED NICKEL'
+  ) AS all_nations
+GROUP BY
+  o_year
+ORDER BY
+  o_year
 --
-ERROR: syntax error (4 : 3)
-		when nation = 'UNITED STATES' the...
-		^
+ERROR: syntax error (4 : 5)
+    when nation = 'UNITED STATES' the...
+    ^
 ==
 
 # Query 9
-select
-	nation,
-	o_year,
-	sum(amount) as sum_profit
-from
-	(
-		select
-			n_name as nation,
-			extract(year from o_orderdate) as o_year,
-			l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount
-		from
-			part,
-			supplier,
-			lineitem,
-			partsupp,
-			orders,
-			nation
-		where
-			s_suppkey = l_suppkey
-			and ps_suppkey = l_suppkey
-			and ps_partkey = l_partkey
-			and p_partkey = l_partkey
-			and o_orderkey = l_orderkey
-			and s_nationkey = n_nationkey
-			and p_name like '%ghost%'
-	) as profit
-group by
-	nation,
-	o_year
-order by
-	nation,
-	o_year desc
+SELECT
+  nation,
+  o_year,
+  SUM(amount) AS sum_profit
+FROM
+  (
+    SELECT
+      n_name AS nation,
+      EXTRACT(year FROM o_orderdate) AS o_year,
+      l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity AS amount
+    FROM
+      part,
+      supplier,
+      lineitem,
+      partsupp,
+      orders,
+      nation
+    WHERE
+      s_suppkey = l_suppkey
+      AND ps_suppkey = l_suppkey
+      AND ps_partkey = l_partkey
+      AND p_partkey = l_partkey
+      AND o_orderkey = l_orderkey
+      AND s_nationkey = n_nationkey
+      AND p_name LIKE '%ghost%'
+  ) AS profit
+GROUP BY
+  nation,
+  o_year
+ORDER BY
+  nation,
+  o_year DESC
 --
-ERROR: syntax error (9 : 17)
-			extract(year from o_orderdate) as o_year,
-			             ^
+ERROR: syntax error (9 : 20)
+      EXTRACT(year FROM o_orderdate) AS o_year,
+                   ^
 ==
 
 # Query 10
-select
-	c_custkey,
-	c_name,
-	sum(l_extendedprice * (1 - l_discount)) as revenue,
-	c_acctbal,
-	n_name,
-	c_address,
-	c_phone,
-	c_comment
-from
-	customer,
-	orders,
-	lineitem,
-	nation
-where
-	c_custkey = o_custkey
-	and l_orderkey = o_orderkey
-	and o_orderdate >= date '1994-03-01'
-	and o_orderdate < date '1994-03-01' + interval '3 month'
-	and l_returnflag = 'R'
-	and c_nationkey = n_nationkey
-group by
-	c_custkey,
-	c_name,
-	c_acctbal,
-	c_phone,
-	n_name,
-	c_address,
-	c_comment
-order by
-	revenue desc
-limit 20
+SELECT
+  c_custkey,
+  c_name,
+  SUM(l_extendedprice * (1 - l_discount)) AS revenue,
+  c_acctbal,
+  n_name,
+  c_address,
+  c_phone,
+  c_comment
+FROM
+  customer,
+  orders,
+  lineitem,
+  nation
+WHERE
+  c_custkey = o_custkey
+  AND l_orderkey = o_orderkey
+  AND o_orderdate >= DATE '1994-03-01'
+  AND o_orderdate < DATE '1994-03-01' + INTERVAL '3 month'
+  AND l_returnflag = 'R'
+  AND c_nationkey = n_nationkey
+GROUP BY
+  c_custkey,
+  c_name,
+  c_acctbal,
+  c_phone,
+  n_name,
+  c_address,
+  c_comment
+ORDER BY
+  revenue DESC
+LIMIT 20
 --
 SelectStatement
 +-select_query=Select
@@ -566,7 +566,7 @@
   | +-SelectListItem
   | | +-AttributeReference[attribute_name=c_name]
   | +-SelectListItem[alias=revenue]
-  | | +-FunctionCall[name=sum]
+  | | +-FunctionCall[name=SUM]
   | |   +-Multiply
   | |     +-left_operand=AttributeReference[attribute_name=l_extendedprice]
   | |     +-right_operand=Subtract
@@ -629,429 +629,429 @@
 ==
 
 # Query 11
-select
-	ps_partkey,
-	sum(ps_supplycost * ps_availqty) as value
-from
-	partsupp,
-	supplier,
-	nation
-where
-	ps_suppkey = s_suppkey
-	and s_nationkey = n_nationkey
-	and n_name = 'INDONESIA'
-group by
-	ps_partkey having
-		sum(ps_supplycost * ps_availqty) > (
-			select
-				sum(ps_supplycost * ps_availqty) * 0.0000010000
-			from
-				partsupp,
-				supplier,
-				nation
-			where
-				ps_suppkey = s_suppkey
-				and s_nationkey = n_nationkey
-				and n_name = 'INDONESIA'
-		)
-order by
-	value desc
+SELECT
+  ps_partkey,
+  SUM(ps_supplycost * ps_availqty) AS value
+FROM
+  partsupp,
+  supplier,
+  nation
+WHERE
+  ps_suppkey = s_suppkey
+  AND s_nationkey = n_nationkey
+  AND n_name = 'INDONESIA'
+GROUP BY
+  ps_partkey HAVING
+    SUM(ps_supplycost * ps_availqty) > (
+      SELECT
+        SUM(ps_supplycost * ps_availqty) * 0.0000010000
+      FROM
+        partsupp,
+        supplier,
+        nation
+      WHERE
+        ps_suppkey = s_suppkey
+        AND s_nationkey = n_nationkey
+        AND n_name = 'INDONESIA'
+    )
+ORDER BY
+  value DESC
 --
-ERROR: syntax error (15 : 4)
-			select
-			^
+ERROR: syntax error (15 : 7)
+      SELECT
+      ^
 ==
 
 # Query 12
-select
-	l_shipmode,
-	sum(case
-		when o_orderpriority = '1-URGENT'
-			or o_orderpriority = '2-HIGH'
-			then 1
-		else 0
-	end) as high_line_count,
-	sum(case
-		when o_orderpriority <> '1-URGENT'
-			and o_orderpriority <> '2-HIGH'
-			then 1
-		else 0
-	end) as low_line_count
-from
-	orders,
-	lineitem
-where
-	o_orderkey = l_orderkey
-	and l_shipmode in ('REG AIR', 'RAIL')
-	and l_commitdate < l_receiptdate
-	and l_shipdate < l_commitdate
-	and l_receiptdate >= date '1997-01-01'
-	and l_receiptdate < date '1997-01-01' + interval '1 year'
-group by
-	l_shipmode
-order by
-	l_shipmode
+SELECT
+  l_shipmode,
+  SUM(case
+    when o_orderpriority = '1-URGENT'
+      OR o_orderpriority = '2-HIGH'
+      then 1
+    else 0
+  end) AS high_line_count,
+  SUM(case
+    when o_orderpriority <> '1-URGENT'
+      AND o_orderpriority <> '2-HIGH'
+      then 1
+    else 0
+  end) AS low_line_count
+FROM
+  orders,
+  lineitem
+WHERE
+  o_orderkey = l_orderkey
+  AND l_shipmode in ('REG AIR', 'RAIL')
+  AND l_commitdate < l_receiptdate
+  AND l_shipdate < l_commitdate
+  AND l_receiptdate >= DATE '1997-01-01'
+  AND l_receiptdate < DATE '1997-01-01' + INTERVAL '1 year'
+GROUP BY
+  l_shipmode
+ORDER BY
+  l_shipmode
 --
-ERROR: syntax error (4 : 3)
-		when o_orderpriority = '1-URGEN...
-		^
+ERROR: syntax error (4 : 5)
+    when o_orderpriority = '1-URGEN...
+    ^
 ==
 
 # Query 13
-select
-	c_count,
-	count(*) as custdist
-from
-	(
-		select
-			c_custkey,
-			count(o_orderkey)
-		from
-			customer left outer join orders on
-				c_custkey = o_custkey
-				and o_comment not like '%special%requests%'
-		group by
-			c_custkey
-	) as  c_orders (c_custkey, c_count)
-group by
-	c_count
-order by
-	custdist desc,
-	c_count desc
+SELECT
+  c_count,
+  COUNT(*) AS custdist
+FROM
+  (
+    SELECT
+      c_custkey,
+      COUNT(o_orderkey)
+    FROM
+      customer LEFT OUTER JOIN orders ON
+        c_custkey = o_custkey
+        AND o_comment NOT LIKE '%special%requests%'
+    GROUP BY
+      c_custkey
+  ) AS  c_orders (c_custkey, c_count)
+GROUP BY
+  c_count
+ORDER BY
+  custdist desc,
+  c_count DESC
 --
-ERROR: syntax error (12 : 23)
-				and o_comment not like '%special%requests%'
-				                  ^
+ERROR: syntax error (12 : 27)
+        AND o_comment NOT LIKE '%special%requests%'
+                          ^
 ==
 
 # Query 14
-select
-	100.00 * sum(case
-		when p_type like 'PROMO%'
-			then l_extendedprice * (1 - l_discount)
-		else 0
-	end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
-from
-	lineitem,
-	part
-where
-	l_partkey = p_partkey
-	and l_shipdate >= date '1994-11-01'
-	and l_shipdate < date '1994-11-01' + interval '1 month'
+SELECT
+  100.00 * sum(case
+    when p_type LIKE 'PROMO%'
+      then l_extendedprice * (1 - l_discount)
+    else 0
+  end) / SUM(l_extendedprice * (1 - l_discount)) AS promo_revenue
+FROM
+  lineitem,
+  part
+WHERE
+  l_partkey = p_partkey
+  AND l_shipdate >= DATE '1994-11-01'
+  AND l_shipdate < DATE '1994-11-01' + INTERVAL '1 month'
 --
-ERROR: syntax error (3 : 3)
-		when p_type like 'PROMO%'
-		^
+ERROR: syntax error (3 : 5)
+    when p_type LIKE 'PROMO%'
+    ^
 ==
 
 # Query 15
-with revenue (supplier_no, total_revenue) as (
-select
-	l_suppkey,
-	sum(l_extendedprice * (1-l_discount))
-from
-	lineitem
-	where
-	l_shipdate >= date '1996-11-01'
-	and l_shipdate < date '1996-11-01' + interval '3 month'
-group by
-	l_suppkey
-) select
-	s_suppkey,
-	s_name,
-	s_address,
-	s_phone,
-	total_revenue
-from
-	supplier,
-	revenue
-where
-	s_suppkey = supplier_no and total_revenue = (
-select
-	max(total_revenue)
-from
-	revenue
+WITH revenue (supplier_no, total_revenue) AS (
+SELECT
+  l_suppkey,
+  sum(l_extendedprice * (1-l_discount))
+FROM
+  lineitem
+  WHERE
+  l_shipdate >= DATE '1996-11-01'
+  AND l_shipdate < DATE '1996-11-01' + INTERVAL '3 month'
+GROUP BY
+  l_suppkey
+) SELECT
+  s_suppkey,
+  s_name,
+  s_address,
+  s_phone,
+  total_revenue
+FROM
+  supplier,
+  revenue
+WHERE
+  s_suppkey = supplier_no AND total_revenue = (
+SELECT
+  MAX(total_revenue)
+FROM
+  revenue
 )
-order by
-	s_suppkey
+ORDER BY
+  s_suppkey
 --
 ERROR: syntax error (23 : 1)
-select
+SELECT
 ^
 ==
 
 # Query 16
-select
-	p_brand,
-	p_type,
-	p_size,
-	count(distinct ps_suppkey) as supplier_cnt
-from
-	partsupp,
-	part
-where
-	p_partkey = ps_partkey
-	and p_brand <> 'Brand#22'
-	and p_type not like 'ECONOMY BURNISHED%'
-	and p_size in (32, 42, 9, 18, 50, 30, 12, 21)
-	and ps_suppkey not in (
-		select
-			s_suppkey
-		from
-			supplier
-		where
-			s_comment like '%Customer%Complaints%'
-	)
-group by
-	p_brand,
-	p_type,
-	p_size
-order by
-	supplier_cnt desc,
-	p_brand,
-	p_type,
-	p_size
+SELECT
+  p_brand,
+  p_type,
+  p_size,
+  COUNT(distinct ps_suppkey) AS supplier_cnt
+FROM
+  partsupp,
+  part
+WHERE
+  p_partkey = ps_partkey
+  AND p_brand <> 'Brand#22'
+  AND p_type NOT LIKE 'ECONOMY BURNISHED%'
+  AND p_size IN (32, 42, 9, 18, 50, 30, 12, 21)
+  AND ps_suppkey NOT IN (
+    SELECT
+      s_suppkey
+    FROM
+      supplier
+    WHERE
+      s_comment LIKE '%Customer%Complaints%'
+  )
+GROUP BY
+  p_brand,
+  p_type,
+  p_size
+ORDER BY
+  supplier_cnt DESC,
+  p_brand,
+  p_type,
+  p_size
 --
-ERROR: syntax error (5 : 8)
-	count(distinct ps_suppkey) as supplie...
-	      ^
+ERROR: syntax error (5 : 9)
+  COUNT(distinct ps_suppkey) AS supplie...
+        ^
 ==
 
 # Query 17
-select
-	sum(l_extendedprice) / 7.0 as avg_yearly
-from
-	lineitem,
-	part
-where
-	p_partkey = l_partkey
-	and p_brand = 'Brand#24'
-	and p_container = 'JUMBO BOX'
-	and l_quantity < (
-		select
-			0.2 * avg(l_quantity)
-		from
-			lineitem
-		where
-			l_partkey = p_partkey
-	)
+SELECT
+  SUM(l_extendedprice) / 7.0 AS avg_yearly
+FROM
+  lineitem,
+  part
+WHERE
+  p_partkey = l_partkey
+  AND p_brand = 'Brand#24'
+  AND p_container = 'JUMBO BOX'
+  AND l_quantity < (
+    SELECT
+      0.2 * AVG(l_quantity)
+    FROM
+      lineitem
+    WHERE
+      l_partkey = p_partkey
+  )
 --
-ERROR: syntax error (11 : 3)
-		select
-		^
+ERROR: syntax error (11 : 5)
+    SELECT
+    ^
 ==
 
 # Query 18
-select
-	c_name,
-	c_custkey,
-	o_orderkey,
-	o_orderdate,
-	o_totalprice,
-	sum(l_quantity)
-from
-	customer,
-	orders,
-	lineitem
-where
-	o_orderkey in (
-		select
-			l_orderkey
-		from
-			lineitem
-		group by
-			l_orderkey having
-				sum(l_quantity) > 314
-	)
-	and c_custkey = o_custkey
-	and o_orderkey = l_orderkey
-group by
-	c_name,
-	c_custkey,
-	o_orderkey,
-	o_orderdate,
-	o_totalprice
-order by
-	o_totalprice desc,
-	o_orderdate
-limit 100
+SELECT
+  c_name,
+  c_custkey,
+  o_orderkey,
+  o_orderdate,
+  o_totalprice,
+  sum(l_quantity)
+FROM
+  customer,
+  orders,
+  lineitem
+WHERE
+  o_orderkey in (
+    SELECT
+      l_orderkey
+    FROM
+      lineitem
+    GROUP BY
+      l_orderkey HAVING
+        SUM(l_quantity) > 314
+  )
+  AND c_custkey = o_custkey
+  AND o_orderkey = l_orderkey
+GROUP BY
+  c_name,
+  c_custkey,
+  o_orderkey,
+  o_orderdate,
+  o_totalprice
+ORDER BY
+  o_totalprice desc,
+  o_orderdate
+LIMIT 100
 --
-ERROR: syntax error (13 : 13)
-	o_orderkey in (
-	           ^
+ERROR: syntax error (13 : 14)
+  o_orderkey in (
+             ^
 ==
 
 # Query 19
-select
-	sum(l_extendedprice* (1 - l_discount)) as revenue
-from
-	lineitem,
-	part
-where
-	(
-		p_partkey = l_partkey
-		and p_brand = 'Brand#45'
-		and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
-		and l_quantity >= 2 and l_quantity <= 2 + 10
-		and p_size between 1 and 5
-		and l_shipmode in ('AIR', 'AIR REG')
-		and l_shipinstruct = 'DELIVER IN PERSON'
-	)
-	or
-	(
-		p_partkey = l_partkey
-		and p_brand = 'Brand#12'
-		and p_container in ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
-		and l_quantity >= 13 and l_quantity <= 13 + 10
-		and p_size between 1 and 10
-		and l_shipmode in ('AIR', 'AIR REG')
-		and l_shipinstruct = 'DELIVER IN PERSON'
-	)
-	or
-	(
-		p_partkey = l_partkey
-		and p_brand = 'Brand#53'
-		and p_container in ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
-		and l_quantity >= 24 and l_quantity <= 24 + 10
-		and p_size between 1 and 15
-		and l_shipmode in ('AIR', 'AIR REG')
-		and l_shipinstruct = 'DELIVER IN PERSON'
-	)
+SELECT
+  SUM(l_extendedprice* (1 - l_discount)) AS revenue
+FROM
+  lineitem,
+  part
+WHERE
+  (
+    p_partkey = l_partkey
+    AND p_brand = 'Brand#45'
+    AND p_container IN ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG')
+    AND l_quantity >= 2 AND l_quantity <= 2 + 10
+    AND p_size BETWEEN 1 AND 5
+    AND l_shipmode IN ('AIR', 'AIR REG')
+    AND l_shipinstruct = 'DELIVER IN PERSON'
+  )
+  OR
+  (
+    p_partkey = l_partkey
+    AND p_brand = 'Brand#12'
+    AND p_container IN ('MED BAG', 'MED BOX', 'MED PKG', 'MED PACK')
+    AND l_quantity >= 13 AND l_quantity <= 13 + 10
+    AND p_size BETWEEN 1 AND 10
+    AND l_shipmode IN ('AIR', 'AIR REG')
+    AND l_shipinstruct = 'DELIVER IN PERSON'
+  )
+  OR
+  (
+    p_partkey = l_partkey
+    AND p_brand = 'Brand#53'
+    AND p_container IN ('LG CASE', 'LG BOX', 'LG PACK', 'LG PKG')
+    AND l_quantity >= 24 AND l_quantity <= 24 + 10
+    AND p_size BETWEEN 1 AND 15
+    AND l_shipmode IN ('AIR', 'AIR REG')
+    AND l_shipinstruct = 'DELIVER IN PERSON'
+  )
 --
-ERROR: syntax error (10 : 19)
-		and p_container in ('SM CASE', 'SM BOX', 'SM PAC...
-		                ^
+ERROR: syntax error (10 : 21)
+    AND p_container IN ('SM CASE', 'SM BOX', 'SM PAC...
+                    ^
 ==
 
 # Query 20
-select
-	s_name,
-	s_address
-from
-	supplier,
-	nation
-where
-	s_suppkey in (
-		select
-			ps_suppkey
-		from
-			partsupp
-		where
-			ps_partkey in (
-				select
-					p_partkey
-				from
-					part
-				where
-					p_name like 'sandy%'
-			)
-			and ps_availqty > (
-				select
-					0.5 * sum(l_quantity)
-				from
-					lineitem
-				where
-					l_partkey = ps_partkey
-					and l_suppkey = ps_suppkey
-					and l_shipdate >= date '1993-01-01'
-					and l_shipdate < date '1993-01-01' + interval '1 year'
-			)
-	)
-	and s_nationkey = n_nationkey
-	and n_name = 'GERMANY'
-order by
-	s_name
+SELECT
+  s_name,
+  s_address
+FROM
+  supplier,
+  nation
+WHERE
+  s_suppkey in (
+    SELECT
+      ps_suppkey
+    FROM
+      partsupp
+    WHERE
+      ps_partkey IN (
+        SELECT
+          p_partkey
+        FROM
+          part
+        WHERE
+          p_name LIKE 'sandy%'
+      )
+      AND ps_availqty > (
+        SELECT
+          0.5 * SUM(l_quantity)
+        FROM
+          lineitem
+        WHERE
+          l_partkey = ps_partkey
+          AND l_suppkey = ps_suppkey
+          AND l_shipdate >= DATE '1993-01-01'
+          AND l_shipdate < DATE '1993-01-01' + INTERVAL '1 year'
+      )
+  )
+  AND s_nationkey = n_nationkey
+  AND n_name = 'GERMANY'
+ORDER BY
+  s_name
 --
-ERROR: syntax error (8 : 12)
-	s_suppkey in (
-	          ^
+ERROR: syntax error (8 : 13)
+  s_suppkey in (
+            ^
 ==
 
 # Query 21
-select
-	s_name,
-	count(*) as numwait
-from
-	supplier,
-	lineitem l1,
-	orders,
-	nation
-where
-	s_suppkey = l1.l_suppkey
-	and o_orderkey = l1.l_orderkey
-	and o_orderstatus = 'F'
-	and l1.l_receiptdate > l1.l_commitdate
-	and exists (
-		select
-			*
-		from
-			lineitem l2
-		where
-			l2.l_orderkey = l1.l_orderkey
-			and l2.l_suppkey <> l1.l_suppkey
-	)
-	and not exists (
-		select
-			*
-		from
-			lineitem l3
-		where
-			l3.l_orderkey = l1.l_orderkey
-			and l3.l_suppkey <> l1.l_suppkey
-			and l3.l_receiptdate > l3.l_commitdate
-	)
-	and s_nationkey = n_nationkey
-	and n_name = 'CANADA'
-group by
-	s_name
-order by
-	numwait desc,
-	s_name
-limit 100
+SELECT
+  s_name,
+  count(*) AS numwait
+FROM
+  supplier,
+  lineitem l1,
+  orders,
+  nation
+WHERE
+  s_suppkey = l1.l_suppkey
+  AND o_orderkey = l1.l_orderkey
+  AND o_orderstatus = 'F'
+  AND l1.l_receiptdate > l1.l_commitdate
+  AND EXISTS (
+    SELECT
+      *
+    FROM
+      lineitem l2
+    WHERE
+      l2.l_orderkey = l1.l_orderkey
+      AND l2.l_suppkey <> l1.l_suppkey
+  )
+  AND NOT EXISTS (
+    SELECT
+      *
+    FROM
+      lineitem l3
+    WHERE
+      l3.l_orderkey = l1.l_orderkey
+      AND l3.l_suppkey <> l1.l_suppkey
+      AND l3.l_receiptdate > l3.l_commitdate
+  )
+  AND s_nationkey = n_nationkey
+  AND n_name = 'CANADA'
+GROUP BY
+  s_name
+ORDER BY
+  numwait desc,
+  s_name
+LIMIT 100
 --
-ERROR: syntax error (15 : 3)
-		select
-		^
+ERROR: syntax error (15 : 5)
+    SELECT
+    ^
 ==
 
 # Query 22
-select
-	cntrycode,
-	count(*) as numcust,
-	sum(c_acctbal) as totacctbal
-from
-	(
-		select
-			substr(c_phone, 1, 2) as cntrycode,
-			c_acctbal
-		from
-			customer
-		where
-			substr(c_phone, 1, 2) in
-				('27', '44', '34', '25', '30', '33', '23')
-			and c_acctbal > (
-				select
-					avg(c_acctbal)
-				from
-					customer
-				where
-					c_acctbal > 0.00
-					and substr(c_phone, 1, 2) in
-						('27', '44', '34', '25', '30', '33', '23')
-			)
-			and not exists (
-				select *
-				from
-					orders
-				where
-					o_custkey = c_custkey
-			)
-	) as custsale
-group by
-	cntrycode
-order by
-	cntrycode
+SELECT
+  cntrycode,
+  COUNT(*) AS numcust,
+  SUM(c_acctbal) AS totacctbal
+FROM
+  (
+    SELECT
+      SUBSTR(c_phone, 1, 2) AS cntrycode,
+      c_acctbal
+    FROM
+      customer
+    WHERE
+      SUBSTR(c_phone, 1, 2) in
+        ('27', '44', '34', '25', '30', '33', '23')
+      AND c_acctbal > (
+        SELECT
+          AVG(c_acctbal)
+        FROM
+          customer
+        WHERE
+          c_acctbal > 0.00
+          AND SUBSTR(c_phone, 1, 2) in
+            ('27', '44', '34', '25', '30', '33', '23')
+      )
+      AND NOT exists (
+        SELECT *
+        FROM
+          orders
+        WHERE
+          o_custkey = c_custkey
+      )
+  ) AS custsale
+GROUP BY
+  cntrycode
+ORDER BY
+  cntrycode
 --
-ERROR: syntax error (13 : 26)
-			substr(c_phone, 1, 2) in
-			                      ^
+ERROR: syntax error (13 : 29)
+      SUBSTR(c_phone, 1, 2) in
+                            ^
diff --git a/parser/tests/Update.test b/parser/tests/Update.test
index c94a194..6ed31e6 100644
--- a/parser/tests/Update.test
+++ b/parser/tests/Update.test
@@ -13,21 +13,21 @@
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 
-update table test set attr = 1
+UPDATE TABLE test SET attr = 1
 --
 ERROR: syntax error (1 : 8)
-update table test set attr = 1
+UPDATE TABLE test SET attr = 1
        ^
 ==
 
-update table set attr = 1
+UPDATE TABLE SET attr = 1
 --
 ERROR: syntax error (1 : 8)
-update table set attr = 1
+UPDATE TABLE SET attr = 1
        ^
 ==
 
-update test set attr1 = 1, attr2=5, attr3 = 4 where attr2 < 1 and attr1 > 5 and attr1+1<2*attr2
+UPDATE test SET attr1 = 1, attr2=5, attr3 = 4 WHERE attr2 < 1 AND attr1 > 5 AND attr1+1<2*attr2
 --
 UpdateStatement[relation_name=test]
 +-where_predicate=And
@@ -60,7 +60,7 @@
       +-NumericLiteral[numeric_string=4,float_like=false]
 ==
 
-update test set attr = 4+1
+UPDATE test SET attr = 4+1
 --
 UpdateStatement[relation_name=test]
 +-assignment=
@@ -72,8 +72,8 @@
         +-NumericLiteral[numeric_string=1,float_like=false]
 ==
 
-update test where attr2=1
+UPDATE test WHERE attr2=1
 --
 ERROR: syntax error (1 : 13)
-update test where attr2=1
+UPDATE test WHERE attr2=1
             ^
diff --git a/query_execution/Foreman.cpp b/query_execution/Foreman.cpp
index c5ef4b4..25612a1 100644
--- a/query_execution/Foreman.cpp
+++ b/query_execution/Foreman.cpp
@@ -1,6 +1,6 @@
 /**
  *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ *   Copyright 2015-2016 Pivotal Software, Inc.
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -29,6 +29,7 @@
 #include "query_execution/WorkerDirectory.hpp"
 #include "query_execution/WorkerMessage.hpp"
 #include "relational_operators/RebuildWorkOrder.hpp"
+#include "relational_operators/RelationalOperator.hpp"
 #include "relational_operators/WorkOrder.hpp"
 #include "storage/InsertDestination.hpp"
 #include "storage/StorageBlock.hpp"
@@ -46,35 +47,32 @@
 
 namespace quickstep {
 
-bool Foreman::initialize() {
+void Foreman::initialize() {
   if (cpu_id_ >= 0) {
     // We can pin the foreman thread to a CPU if specified.
     ThreadUtil::BindToCPU(cpu_id_);
   }
   DEBUG_ASSERT(query_dag_ != nullptr);
 
-  const dag_node_index dag_size = query_dag_->size();
   initializeState();
 
   // Collect all the workorders from all the relational operators in the DAG.
+  const dag_node_index dag_size = query_dag_->size();
   for (dag_node_index index = 0; index < dag_size; ++index) {
-    RelationalOperator *curr_op = query_dag_->getNodePayloadMutable(index);
     if (checkAllBlockingDependenciesMet(index)) {
-      curr_op->informAllBlockingDependenciesMet();
-      processOperator(curr_op, index, false);
+      query_dag_->getNodePayloadMutable(index)->informAllBlockingDependenciesMet();
+      processOperator(index, false);
     }
   }
 
   // Dispatch the WorkOrders generated so far.
   dispatchWorkerMessages(0, 0);
-  return num_operators_finished_ == dag_size;
 }
 
 // TODO(harshad) - There is duplication in terms of functionality provided by
 // TMB and ForemanMessage class with respect to determining the message types.
 // Try to use TMB message types for infering the messsage types consistently.
-bool Foreman::processMessage(const ForemanMessage &message) {
-  const dag_node_index dag_size = query_dag_->size();
+void Foreman::processMessage(const ForemanMessage &message) {
   // Get the relational operator that caused this message to be sent.
   dag_node_index response_op_index = message.getRelationalOpIndex();
   const int worker_id = message.getWorkerID();
@@ -90,9 +88,7 @@
         workers_->decrementNumQueuedWorkOrders(worker_id);
 
         // Check if new work orders are available and fetch them if so.
-        fetchNormalWorkOrders(
-            query_dag_->getNodePayloadMutable(response_op_index),
-            response_op_index);
+        fetchNormalWorkOrders(response_op_index);
 
         if (checkRebuildRequired(response_op_index)) {
           if (checkNormalExecutionOver(response_op_index)) {
@@ -116,14 +112,13 @@
           markOperatorFinished(response_op_index);
         }
 
-        for (pair<dag_node_index, bool> dependent_link :
+        for (const pair<dag_node_index, bool> &dependent_link :
              query_dag_->getDependents(response_op_index)) {
-          RelationalOperator *dependent_op =
-              query_dag_->getNodePayloadMutable(dependent_link.first);
-          if (checkAllBlockingDependenciesMet(dependent_link.first)) {
+          const dag_node_index dependent_op_index = dependent_link.first;
+          if (checkAllBlockingDependenciesMet(dependent_op_index)) {
             // Process the dependent operator (of the operator whose WorkOrder
             // was just executed) for which all the dependencies have been met.
-            processOperator(dependent_op, dependent_link.first, true);
+            processOperator(dependent_op_index, true);
           }
         }
       }
@@ -137,12 +132,11 @@
 
         if (checkRebuildOver(response_op_index)) {
           markOperatorFinished(response_op_index);
-          for (pair<dag_node_index, bool> dependent_link :
+          for (const pair<dag_node_index, bool> &dependent_link :
                query_dag_->getDependents(response_op_index)) {
-            RelationalOperator *dependent_op =
-                query_dag_->getNodePayloadMutable(dependent_link.first);
-            if (checkAllBlockingDependenciesMet(dependent_link.first)) {
-              processOperator(dependent_op, dependent_link.first, true);
+            const dag_node_index dependent_op_index = dependent_link.first;
+            if (checkAllBlockingDependenciesMet(dependent_op_index)) {
+              processOperator(dependent_op_index, true);
             }
           }
         }
@@ -152,7 +146,7 @@
       {
         // Data streaming message. Possible senders of this message include
         // InsertDestination and some operators which modify existing blocks.
-        for (dag_node_index consumer_index :
+        for (const dag_node_index consumer_index :
              output_consumers_[response_op_index]) {
           RelationalOperator *consumer_op =
               query_dag_->getNodePayloadMutable(consumer_index);
@@ -164,15 +158,13 @@
                                       message.getRelationID());
           // Because of the streamed input just fed, check if there are any new
           // WorkOrders available and if so, fetch them.
-          fetchNormalWorkOrders(consumer_op, consumer_index);
+          fetchNormalWorkOrders(consumer_index);
         }  // end for (feeding input to dependents)
       }
       break;
     case ForemanMessage::kWorkOrdersAvailable: {
       // Check if new work orders are available.
-      fetchNormalWorkOrders(
-          query_dag_->getNodePayloadMutable(response_op_index),
-          response_op_index);
+      fetchNormalWorkOrders(response_op_index);
       break;
     }
     default:
@@ -184,7 +176,6 @@
   // candidate worker to receive the next WorkOrder is the one that sent the
   // response message to Foreman.
   dispatchWorkerMessages(((worker_id >= 0) ? worker_id : 0), response_op_index);
-  return num_operators_finished_ == dag_size;
 }
 
 void Foreman::processFeedbackMessage(const WorkOrder::FeedbackMessage &msg) {
@@ -195,10 +186,10 @@
 
 void Foreman::run() {
   // Initialize before for Foreman eventloop.
-  bool done = initialize();
+  initialize();
 
   // Event loop
-  while (!done) {
+  while (!checkQueryExecutionFinished()) {
     // Receive() causes this thread to sleep until next message is received.
     AnnotatedMessage annotated_msg = bus_->Receive(foreman_client_id_, 0, true);
     // Message is either workorder feedback message or foreman message.
@@ -208,8 +199,8 @@
           annotated_msg.tagged_message.message_bytes());
       processFeedbackMessage(msg);
     } else {
-      done = processMessage(*static_cast<const ForemanMessage *>(
-                                annotated_msg.tagged_message.message()));
+      processMessage(*static_cast<const ForemanMessage *>(
+          annotated_msg.tagged_message.message()));
     }
   }
 
@@ -247,8 +238,8 @@
 
 WorkerMessage* Foreman::generateWorkerMessage(
     WorkOrder *workorder,
-    dag_node_index index,
-    WorkerMessage::WorkerMessageType type) {
+    const dag_node_index index,
+    const WorkerMessage::WorkerMessageType type) {
   std::unique_ptr<WorkerMessage> worker_message;
   switch (type) {
     case WorkerMessage::kWorkOrder :
@@ -288,16 +279,17 @@
       rebuild_status_[node_index] = std::make_pair(false, 0);
     }
 
-    for (pair<dag_node_index, bool> dependent_link :
+    for (const pair<dag_node_index, bool> &dependent_link :
          query_dag_->getDependents(node_index)) {
-      if (!query_dag_->getLinkMetadata(node_index, dependent_link.first)) {
+      const dag_node_index dependent_op_index = dependent_link.first;
+      if (!query_dag_->getLinkMetadata(node_index, dependent_op_index)) {
         // The link is not a pipeline-breaker. Streaming of blocks is possible
         // between these two operators.
-        output_consumers_[node_index].push_back(dependent_link.first);
+        output_consumers_[node_index].push_back(dependent_op_index);
       } else {
         // The link is a pipeline-breaker. Streaming of blocks is not possible
         // between these two operators.
-        blocking_dependencies_[dependent_link.first].push_back(node_index);
+        blocking_dependencies_[dependent_op_index].push_back(node_index);
       }
     }
   }
@@ -362,7 +354,7 @@
   return nullptr;
 }
 
-void Foreman::sendWorkerMessage(std::size_t worker_id,
+void Foreman::sendWorkerMessage(const std::size_t worker_id,
                                 const WorkerMessage &message) {
   message_type_id type;
   if (message.getType() == WorkerMessage::kRebuildWorkOrder) {
@@ -381,12 +373,18 @@
                                      move(worker_tagged_message));
 }
 
-bool Foreman::fetchNormalWorkOrders(RelationalOperator *op, dag_node_index index) {
+bool Foreman::fetchNormalWorkOrders(const dag_node_index index) {
   bool generated_new_workorders = false;
   if (!done_gen_[index]) {
+    // Do not fetch any work units until all blocking dependencies are met.
+    // The releational operator is not aware of blocking dependencies for
+    // uncorrelated scalar queries.
+    if (!checkAllBlockingDependenciesMet(index)) {
+      return false;
+    }
     const size_t num_pending_workorders_before =
         workorders_container_->getNumNormalWorkOrders(index);
-    done_gen_[index] = op->getAllWorkOrders(workorders_container_.get());
+    done_gen_[index] = query_dag_->getNodePayloadMutable(index)->getAllWorkOrders(workorders_container_.get());
 
     // TODO(shoban): It would be a good check to see if operator is making
     // useful progress, i.e., the operator either generates work orders to
@@ -402,10 +400,9 @@
   return generated_new_workorders;
 }
 
-void Foreman::processOperator(RelationalOperator *op,
-                              dag_node_index index,
-                              bool recursively_check_dependents) {
-  if (fetchNormalWorkOrders(op, index)) {
+void Foreman::processOperator(const dag_node_index index,
+                              const bool recursively_check_dependents) {
+  if (fetchNormalWorkOrders(index)) {
     // Fetched work orders. Return to wait for the generated work orders to
     // execute, and skip the execution-finished checks.
     return;
@@ -432,35 +429,35 @@
     }
     // If we reach here, that means the operator has been marked as finished.
     if (recursively_check_dependents) {
-      for (pair<dag_node_index, bool> dependent_link :
+      for (const pair<dag_node_index, bool> &dependent_link :
            query_dag_->getDependents(index)) {
-        if (checkAllBlockingDependenciesMet(dependent_link.first)) {
-          processOperator(
-              query_dag_->getNodePayloadMutable(dependent_link.first),
-              dependent_link.first, true);
+        const dag_node_index dependent_op_index = dependent_link.first;
+        if (checkAllBlockingDependenciesMet(dependent_op_index)) {
+          processOperator(dependent_op_index, true);
         }
       }
     }
   }
 }
 
-void Foreman::markOperatorFinished(dag_node_index index) {
+void Foreman::markOperatorFinished(const dag_node_index index) {
   execution_finished_[index] = true;
   ++num_operators_finished_;
   const relation_id output_rel = query_dag_->getNodePayload(index).getOutputRelationID();
-  for (pair<dag_node_index, bool> dependent_link : query_dag_->getDependents(index)) {
-    RelationalOperator *dependent_op = query_dag_->getNodePayloadMutable(dependent_link.first);
+  for (const pair<dag_node_index, bool> &dependent_link : query_dag_->getDependents(index)) {
+    const dag_node_index dependent_op_index = dependent_link.first;
+    RelationalOperator *dependent_op = query_dag_->getNodePayloadMutable(dependent_op_index);
     // Signal dependent operator that current operator is done feeding input blocks.
     if (output_rel >= 0) {
       dependent_op->doneFeedingInputBlocks(output_rel);
     }
-    if (checkAllBlockingDependenciesMet(dependent_link.first)) {
+    if (checkAllBlockingDependenciesMet(dependent_op_index)) {
       dependent_op->informAllBlockingDependenciesMet();
     }
   }
 }
 
-bool Foreman::initiateRebuild(dag_node_index index) {
+bool Foreman::initiateRebuild(const dag_node_index index) {
   DEBUG_ASSERT(!workorders_container_->hasRebuildWorkOrder(index));
   DEBUG_ASSERT(checkRebuildRequired(index));
   DEBUG_ASSERT(!checkRebuildInitiated(index));
@@ -473,7 +470,7 @@
   return (rebuild_status_[index].second == 0);
 }
 
-void Foreman::getRebuildWorkOrders(dag_node_index index, WorkOrdersContainer *container) {
+void Foreman::getRebuildWorkOrders(const dag_node_index index, WorkOrdersContainer *container) {
   const RelationalOperator &op = query_dag_->getNodePayload(index);
   const QueryContext::insert_destination_id insert_destination_index = op.getInsertDestinationID();
 
diff --git a/query_execution/Foreman.hpp b/query_execution/Foreman.hpp
index 09d150b..f41e98b 100644
--- a/query_execution/Foreman.hpp
+++ b/query_execution/Foreman.hpp
@@ -1,6 +1,6 @@
 /**
  *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ *   Copyright 2015-2016 Pivotal Software, Inc.
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -154,6 +154,15 @@
   typedef DAG<RelationalOperator, bool>::size_type_nodes dag_node_index;
 
   /**
+   * @brief Check if the current query has finished its execution.
+   *
+   * @return True if the query has finished. Otherwise false.
+   **/
+  bool checkQueryExecutionFinished() const {
+    return num_operators_finished_ == query_dag_->size();
+  }
+
+  /**
    * @brief Check if all the dependencies of the node at specified index have
    *        finished their execution.
    *
@@ -165,8 +174,8 @@
    * @return True if all the dependencies have finished their execution. False
    *         otherwise.
    **/
-  inline bool checkAllDependenciesMet(dag_node_index node_index) const {
-    for (dag_node_index dependency_index : query_dag_->getDependencies(node_index)) {
+  inline bool checkAllDependenciesMet(const dag_node_index node_index) const {
+    for (const dag_node_index dependency_index : query_dag_->getDependencies(node_index)) {
       // If at least one of the dependencies is not met, return false.
       if (!execution_finished_[dependency_index]) {
         return false;
@@ -188,8 +197,8 @@
    * @return True if all the blocking dependencies have finished their
    *         execution. False otherwise.
    **/
-  inline bool checkAllBlockingDependenciesMet(dag_node_index node_index) const {
-    for (dag_node_index blocking_dependency_index : blocking_dependencies_[node_index]) {
+  inline bool checkAllBlockingDependenciesMet(const dag_node_index node_index) const {
+    for (const dag_node_index blocking_dependency_index : blocking_dependencies_[node_index]) {
       if (!execution_finished_[blocking_dependency_index]) {
         return false;
       }
@@ -220,8 +229,8 @@
    * @return A pointer to the created message.
    **/
   WorkerMessage* generateWorkerMessage(WorkOrder *workorder,
-                                       dag_node_index index,
-                                       WorkerMessage::WorkerMessageType type);
+                                       const dag_node_index index,
+                                       const WorkerMessage::WorkerMessageType type);
 
   /**
    * @brief Initialize all the local vectors and maps. If the operator has an
@@ -234,26 +243,18 @@
    * @brief Initialize the Foreman before starting the event loop. This binds
    * the Foreman thread to configured CPU, and does initial processing of
    * operator before waiting for events from Workers.
-   *
-   * @return Whether the Foreman is done processing execution. In a corner
-   *         case, when operators don't generate work orders, Foreman is done
-   *         with execution immediately in the initialize step.
    **/
-  bool initialize();
+  void initialize();
 
   /**
    * @brief Process a message sent to Foreman.
    *
    * @param messsage Message sent to Foreman.
    *
-   * @return Whether Foreman has completed processing and scheduling the DAG,
-   *         i.e., all operators in DAG have completely finished generating
-   *         work, and all WorkOrders have finished executing.
-   *
    * @note We still need to cleanUp() before exiting, if we want to reuse this
    *       Foreman instance for processing another DAG.
    **/
-  bool processMessage(const ForemanMessage &message);
+  void processMessage(const ForemanMessage &message);
 
   /**
    * @brief Process work order feedback message and notify relational operator.
@@ -279,12 +280,12 @@
    *        them in the WorkOrdersContainer for this query. If the operator can
    *        be marked as done, do so.
    *
-   * @param op The Relational operator to be processed.
-   * @param index The index of op in the query plan DAG.
+   * @param index The index of the relational operator to be processed in the
+   *        query plan DAG.
    * @param recursively_check_dependents If an operator is done, should we
    *        call processOperator on its dependents recursively.
    **/
-  void processOperator(RelationalOperator *op, dag_node_index index, bool recursively_check_dependents);
+  void processOperator(const dag_node_index index, const bool recursively_check_dependents);
 
  /**
    * @brief Get the next workorder to be excuted, wrapped in a WorkerMessage.
@@ -306,18 +307,18 @@
    * @param worker_id The logical ID of the recipient worker.
    * @param message The WorkerMessage to be sent.
    **/
-  void sendWorkerMessage(std::size_t worker_id, const WorkerMessage &message);
+  void sendWorkerMessage(const std::size_t worker_id, const WorkerMessage &message);
 
   /**
    * @brief Fetch all work orders currently available in relational operator and
    *        store them internally.
    *
-   * @param op The Relational operator to be processed.
-   * @param index The index of op in the query plan DAG.
+   * @param index The index of the relational operator to be processed in the
+   *        query plan DAG.
    *
    * @return Whether any work order was generated by op.
    **/
-  bool fetchNormalWorkOrders(RelationalOperator *op, dag_node_index index);
+  bool fetchNormalWorkOrders(const dag_node_index index);
 
   /**
    * @brief This function does the following things:
@@ -331,7 +332,7 @@
    *
    * @param index The index of the given relational operator in the DAG.
    **/
-  void markOperatorFinished(dag_node_index index);
+  void markOperatorFinished(const dag_node_index index);
 
   /**
    * @brief Check if the execution of the given operator is over.
@@ -341,7 +342,7 @@
    * @return True if the execution of the given operator is over, false
    *         otherwise.
    **/
-  inline bool checkOperatorExecutionOver(dag_node_index index) const {
+  inline bool checkOperatorExecutionOver(const dag_node_index index) const {
     if (checkRebuildRequired(index)) {
       return (checkNormalExecutionOver(index) && checkRebuildOver(index));
     } else {
@@ -363,7 +364,7 @@
    * @return True if the normal execution of the given operator is over, false
    *         otherwise.
    **/
-  inline bool checkNormalExecutionOver(dag_node_index index) const {
+  inline bool checkNormalExecutionOver(const dag_node_index index) const {
     return (checkAllDependenciesMet(index) &&
             !workorders_container_->hasNormalWorkOrder(index) &&
             queued_workorders_per_op_[index] == 0 &&
@@ -377,7 +378,7 @@
    *
    * @return True if the rebuild operation is required, false otherwise.
    **/
-  inline bool checkRebuildRequired(dag_node_index index) const {
+  inline bool checkRebuildRequired(const dag_node_index index) const {
     return rebuild_required_[index];
   }
 
@@ -419,7 +420,7 @@
    * @return True if the rebuild is over immediately, i.e. the operator didn't
    *         generate any rebuild WorkOrders, false otherwise.
    **/
-  bool initiateRebuild(dag_node_index index);
+  bool initiateRebuild(const dag_node_index index);
 
   /**
    * @brief Get the rebuild WorkOrders for an operator.
@@ -431,7 +432,7 @@
    * @param container A pointer to a WorkOrdersContainer to be used to store the
    *        generated WorkOrders.
    **/
-  void getRebuildWorkOrders(dag_node_index index, WorkOrdersContainer *container);
+  void getRebuildWorkOrders(const dag_node_index index, WorkOrdersContainer *container);
 
   MessageBus *bus_;
 
diff --git a/query_execution/WorkOrdersContainer.cpp b/query_execution/WorkOrdersContainer.cpp
index 7ec58d8..d72b6f3 100644
--- a/query_execution/WorkOrdersContainer.cpp
+++ b/query_execution/WorkOrdersContainer.cpp
@@ -1,6 +1,6 @@
 /**
  *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ *   Copyright 2015-2016 Pivotal Software, Inc.
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -20,50 +20,37 @@
 #include <algorithm>
 #include <cstddef>
 #include <list>
+#include <memory>
 #include <vector>
 
 #include "relational_operators/WorkOrder.hpp"
 
+#include "glog/logging.h"
+
+using std::unique_ptr;
+
 namespace quickstep {
 
 WorkOrdersContainer::~WorkOrdersContainer() {
   // For each operator ..
-  bool workorders_found = false;
   for (std::size_t op = 0; op < num_operators_; ++op) {
-    // Delete the leftover WorkOrders.
-    while (hasNormalWorkOrder(op)) {
-      if (!workorders_found) {
-        workorders_found = true;
-      }
-      WorkOrder *work_order = getNormalWorkOrder(op);
-      DEBUG_ASSERT(work_order != nullptr);
-      delete work_order;
+    if (hasNormalWorkOrder(op) || hasRebuildWorkOrder(op)) {
+      LOG(WARNING) << "Destroying a WorkOrdersContainer that still has pending WorkOrders.";
+      break;
     }
-    while (hasRebuildWorkOrder(op)) {
-      if (!workorders_found) {
-        workorders_found = true;
-      }
-      WorkOrder *work_order = getRebuildWorkOrder(op);
-      DEBUG_ASSERT(work_order != nullptr);
-      delete work_order;
-    }
-  }
-  if (workorders_found) {
-    DEV_WARNING(
-        "Destroying a WorkOrdersContainer that still has pending WorkOrders.");
   }
 }
 
 WorkOrder* WorkOrdersContainer::InternalListContainer::getWorkOrderForNUMANode(
     const int numa_node) {
-  for (std::list<WorkOrder*>::iterator it = workorders_.begin();
+  for (std::list<unique_ptr<WorkOrder>>::iterator it = workorders_.begin();
        it != workorders_.end();
        ++it) {
     const std::vector<int> &numa_nodes = (*it)->getPreferredNUMANodes();
     if (!numa_nodes.empty()) {
       if (std::find(numa_nodes.begin(), numa_nodes.end(), numa_node) !=
           numa_nodes.end()) {
-        WorkOrder *work_order = *it;
+        WorkOrder *work_order = it->release();
         workorders_.erase(it);
         return work_order;
       }
@@ -93,7 +80,7 @@
     WorkOrdersContainer::InternalListContainer::getNumWorkOrdersForNUMANode(
     const int numa_node) const {
   std::size_t num_workorders = 0;
-  for (WorkOrder *work_order : workorders_) {
+  for (const unique_ptr<WorkOrder> &work_order : workorders_) {
     const std::vector<int> &numa_nodes = work_order->getPreferredNUMANodes();
     if (!numa_nodes.empty()) {
       std::vector<int>::const_iterator
@@ -109,7 +96,7 @@
 
 bool WorkOrdersContainer::InternalListContainer::hasWorkOrderForNUMANode(
     const int numa_node) const {
-  for (WorkOrder *work_order : workorders_) {
+  for (const unique_ptr<WorkOrder> &work_order : workorders_) {
     const std::vector<int> &numa_nodes = work_order->getPreferredNUMANodes();
     if (!numa_nodes.empty()) {
       std::vector<int>::const_iterator
diff --git a/query_execution/WorkOrdersContainer.hpp b/query_execution/WorkOrdersContainer.hpp
index 3cc93b9..b4a0a03 100644
--- a/query_execution/WorkOrdersContainer.hpp
+++ b/query_execution/WorkOrdersContainer.hpp
@@ -1,6 +1,6 @@
 /**
  *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ *   Copyright 2015-2016 Pivotal Software, Inc.
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -20,16 +20,16 @@
 
 #include <cstddef>
 #include <list>
+#include <memory>
 #include <queue>
 #include <vector>
 
-#include "utility/PtrVector.hpp"
+#include "relational_operators/WorkOrder.hpp"
 #include "utility/Macros.hpp"
+#include "utility/PtrVector.hpp"
 
 namespace quickstep {
 
-class WorkOrder;
-
 /** \addtogroup QueryExecution
  *  @{
  */
@@ -139,10 +139,11 @@
    * @param numa_node_id The NUMA node.
    *
    * @return A WorkOrder which prefers numa_node_id. If no such WorkOrder is
-   *         available, return nullptr.
+   *         available, return nullptr. The caller is responsible for taking the
+   *         ownership.
    **/
   WorkOrder* getNormalWorkOrderForNUMANode(const std::size_t operator_index,
-                                         const int numa_node_id) {
+                                           const int numa_node_id) {
     DEBUG_ASSERT(operator_index < num_operators_);
     DEBUG_ASSERT(numa_node_id >= 0);
     DEBUG_ASSERT(static_cast<std::size_t>(numa_node_id) < num_numa_nodes_);
@@ -158,10 +159,11 @@
    *        prefer exactly one NUMA node over workorders which list more than
    *        one NUMA node as their preference.
    *
-   * @return A WorkOrder. If no WorkOrder is available, returns nullptr.
+   * @return A WorkOrder. If no WorkOrder is available, returns nullptr. The
+   *         caller is responsible for taking the ownership.
    **/
   WorkOrder* getNormalWorkOrder(const std::size_t operator_index,
-                              const bool prefer_single_NUMA_node = true) {
+                                const bool prefer_single_NUMA_node = true) {
     DEBUG_ASSERT(operator_index < num_operators_);
     return normal_workorders_[operator_index].getWorkOrder(
         prefer_single_NUMA_node);
@@ -175,10 +177,11 @@
    * @param numa_node_id The NUMA node.
    *
    * @return A WorkOrder that prefers numa_node_id. If no such WorkOrder is
-   *         available, return nullptr.
+   *         available, return nullptr. The caller is responsible for taking the
+   *         ownership.
    **/
   WorkOrder* getRebuildWorkOrderForNUMANode(const std::size_t operator_index,
-                                          const int numa_node_id) {
+                                            const int numa_node_id) {
     DEBUG_ASSERT(operator_index < num_operators_);
     DEBUG_ASSERT(numa_node_id >= 0);
     DEBUG_ASSERT(static_cast<std::size_t>(numa_node_id) < num_numa_nodes_);
@@ -194,10 +197,11 @@
    *        prefer exactly one NUMA node over workorders which list more than
    *        one NUMA node as their preference.
    *
-   * @return A WorkOrder. If no WorkOrder is available, returns nullptr.
+   * @return A WorkOrder. If no WorkOrder is available, returns nullptr. The
+   *         caller is responsible for taking the ownership.
    **/
   WorkOrder* getRebuildWorkOrder(const std::size_t operator_index,
-                               const bool prefer_single_NUMA_node = true) {
+                                 const bool prefer_single_NUMA_node = true) {
     DEBUG_ASSERT(operator_index < num_operators_);
     return rebuild_workorders_[operator_index].getWorkOrder(
         prefer_single_NUMA_node);
@@ -207,6 +211,7 @@
    * @brief Add a normal (non-rebuild) WorkOrder generated from a given
    *        operator.
    *
+   * @note Take the ownership of \p workorder.
    * @note The workorder to be added contains information about its preferred
    *       NUMA nodes. This information is used to insert the WorkOrder
    *       appropriately.
@@ -223,6 +228,7 @@
   /**
    * @brief Add a rebuild WorkOrder generated from a given operator.
    *
+   * @note Take the ownership of \p workorder.
    * @note The workorder to be added contains information about its preferred
    *       NUMA nodes. This information is used to insert the WorkOrder
    *       appropriately.
@@ -231,7 +237,7 @@
    * @param operator_index The index of the operator in the query DAG.
    **/
   void addRebuildWorkOrder(WorkOrder *workorder,
-                          const std::size_t operator_index) {
+                           const std::size_t operator_index) {
     DEBUG_ASSERT(workorder != nullptr);
     DEBUG_ASSERT(operator_index < num_operators_);
     rebuild_workorders_[operator_index].addWorkOrder(workorder);
@@ -311,16 +317,17 @@
     }
 
     inline void addWorkOrder(WorkOrder *workorder) {
-      workorders_.push(workorder);
+      workorders_.emplace(std::unique_ptr<WorkOrder>(workorder));
     }
 
     inline WorkOrder* getWorkOrder() {
-      if (!workorders_.empty()) {
-        WorkOrder *work_order = workorders_.front();
-        workorders_.pop();
-        return work_order;
+      if (workorders_.empty()) {
+        return nullptr;
       }
-      return nullptr;
+
+      WorkOrder *work_order = workorders_.front().release();
+      workorders_.pop();
+      return work_order;
     }
 
     inline bool hasWorkOrder() const {
@@ -332,7 +339,7 @@
     }
 
    private:
-    std::queue<WorkOrder*> workorders_;
+    std::queue<std::unique_ptr<WorkOrder>> workorders_;
 
     DISALLOW_COPY_AND_ASSIGN(InternalQueueContainer);
   };
@@ -350,16 +357,17 @@
     }
 
     inline void addWorkOrder(WorkOrder *workorder) {
-      workorders_.push_back(workorder);
+      workorders_.emplace_back(std::unique_ptr<WorkOrder>(workorder));
     }
 
     inline WorkOrder* getWorkOrder() {
-      if (!workorders_.empty()) {
-        WorkOrder *work_order = workorders_.front();
-        workorders_.pop_front();
-        return work_order;
+      if (workorders_.empty()) {
+        return nullptr;
       }
-      return nullptr;
+
+      WorkOrder *work_order = workorders_.front().release();
+      workorders_.pop_front();
+      return work_order;
     }
 
     /**
@@ -390,7 +398,7 @@
     std::size_t getNumWorkOrdersForNUMANode(const int numa_node) const;
 
    private:
-    std::list<WorkOrder*> workorders_;
+    std::list<std::unique_ptr<WorkOrder>> workorders_;
 
     DISALLOW_COPY_AND_ASSIGN(InternalListContainer);
   };
diff --git a/query_execution/tests/Foreman_unittest.cpp b/query_execution/tests/Foreman_unittest.cpp
index e2a5ed5..bc65931 100644
--- a/query_execution/tests/Foreman_unittest.cpp
+++ b/query_execution/tests/Foreman_unittest.cpp
@@ -1,6 +1,6 @@
 /**
  *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ *   Copyright 2015-2016 Pivotal Software, Inc.
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -279,30 +279,35 @@
   inline bool placeDataPipelineMessage(const QueryPlan::DAGNodeIndex source_operator_index) {
     VLOG(3) << "Place DataPipeline message for Op[" << source_operator_index << "]";
     ForemanMessage foreman_message(ForemanMessage::DataPipelineMessage(source_operator_index, 0, 0));
-    return foreman_->processMessage(foreman_message);
+    foreman_->processMessage(foreman_message);
+    return foreman_->checkQueryExecutionFinished();
   }
 
   inline bool placeWorkOrderCompleteMessage(const QueryPlan::DAGNodeIndex index) {
     VLOG(3) << "Place WorkOrderComplete message for Op[" << index << "]";
     ForemanMessage foreman_message(ForemanMessage::WorkOrderCompletionMessage(index, 0));
-    return foreman_->processMessage(foreman_message);
+    foreman_->processMessage(foreman_message);
+    return foreman_->checkQueryExecutionFinished();
   }
 
   inline bool placeRebuildWorkOrderCompleteMessage(const QueryPlan::DAGNodeIndex index) {
     VLOG(3) << "Place RebuildWorkOrderComplete message for Op[" << index << "]";
     ForemanMessage foreman_message(ForemanMessage::RebuildCompletionMessage(index, 0));
-    return foreman_->processMessage(foreman_message);
+    foreman_->processMessage(foreman_message);
+    return foreman_->checkQueryExecutionFinished();
   }
 
   inline bool placeOutputBlockMessage(const QueryPlan::DAGNodeIndex index) {
     VLOG(3) << "Place OutputBlock message for Op[" << index << "]";
     ForemanMessage foreman_message(
     ForemanMessage::DataPipelineMessage(index, BlockIdUtil::GetBlockId(1 /* domain */, 1), 0));
-    return foreman_->processMessage(foreman_message);
+    foreman_->processMessage(foreman_message);
+    return foreman_->checkQueryExecutionFinished();
   }
 
   inline bool startForeman() {
-    return foreman_->initialize();
+    foreman_->initialize();
+    return foreman_->checkQueryExecutionFinished();
   }
 
   inline int getWorkerInputQueueSize() {
diff --git a/query_optimizer/ExecutionGenerator.cpp b/query_optimizer/ExecutionGenerator.cpp
index 45154da..3ad47be 100644
--- a/query_optimizer/ExecutionGenerator.cpp
+++ b/query_optimizer/ExecutionGenerator.cpp
@@ -166,7 +166,7 @@
     }
     const QueryPlan::DAGNodeIndex drop_table_index =
         execution_plan_->addRelationalOperator(
-            new DropTableOperator(temporary_relation->getID(),
+            new DropTableOperator(*temporary_relation,
                                   false /* only_drop_blocks */));
     DCHECK(!temporary_relation_info.isStoredRelation());
     execution_plan_->addDependenciesForDropOperator(
@@ -422,13 +422,13 @@
   SelectOperator *op
       = convertSimpleProjection(project_expressions_group_index, attributes.get())
         ? new SelectOperator(*input_relation_info->relation,
-                             output_relation->getID(),
+                             *output_relation,
                              insert_destination_index,
                              execution_predicate_index,
                              attributes.release(),
                              input_relation_info->isStoredRelation())
         : new SelectOperator(*input_relation_info->relation,
-                             output_relation->getID(),
+                             *output_relation,
                              insert_destination_index,
                              execution_predicate_index,
                              project_expressions_group_index,
@@ -596,7 +596,7 @@
               probe_operator_info->isStoredRelation(),
               probe_attribute_ids,
               any_probe_attributes_nullable,
-              output_relation->getID(),
+              *output_relation,
               insert_destination_index,
               join_hash_table_index,
               residual_predicate_index,
@@ -683,7 +683,7 @@
       execution_plan_->addRelationalOperator(new NestedLoopsJoinOperator(
           *left_relation_info->relation,
           *right_relation_info->relation,
-          output_relation->getID(),
+          *output_relation,
           insert_destination_index,
           execution_join_predicate_index,
           project_expressions_group_index,
@@ -714,7 +714,7 @@
     const P::CopyFromPtr &physical_plan) {
   // CopyFrom is converted to a TextScan and a SaveBlocks.
 
-  const relation_id output_relation_id = physical_plan->catalog_relation()->getID();
+  const CatalogRelation *output_relation = physical_plan->catalog_relation();
 
   // Create InsertDestination proto.
   const QueryContext::insert_destination_id insert_destination_index =
@@ -722,7 +722,7 @@
   S::InsertDestination *insert_destination_proto = query_context_proto_->add_insert_destinations();
 
   insert_destination_proto->set_insert_destination_type(S::InsertDestinationType::BLOCK_POOL);
-  insert_destination_proto->set_relation_id(output_relation_id);
+  insert_destination_proto->set_relation_id(output_relation->getID());
   insert_destination_proto->set_need_to_add_blocks_from_relation(true);
   insert_destination_proto->set_foreman_client_id(optimizer_context_->getForemanClientID());
 
@@ -733,7 +733,7 @@
               physical_plan->column_delimiter(),
               physical_plan->escape_strings(),
               FLAGS_parallelize_load,
-              output_relation_id,
+              *output_relation,
               insert_destination_index,
               optimizer_context_->getForemanClientID(),
               optimizer_context_->getMessageBus()));
@@ -770,7 +770,8 @@
   }
 
   execution_plan_->addRelationalOperator(
-      new CreateTableOperator(catalog_relation.release()));
+      new CreateTableOperator(catalog_relation.release(),
+                              optimizer_context_->catalog_database()));
 }
 
 void ExecutionGenerator::convertDeleteTuples(
@@ -795,7 +796,7 @@
        execution_predicate->getStaticResult())) {
     const QueryPlan::DAGNodeIndex drop_table_index =
         execution_plan_->addRelationalOperator(
-            new DropTableOperator(input_relation_info->relation->getID(),
+            new DropTableOperator(*input_relation_info->relation,
                                   true /* only_drop_blocks */));
     if (!input_relation_info->isStoredRelation()) {
       execution_plan_->addDirectDependency(drop_table_index,
@@ -832,7 +833,7 @@
     const P::DropTablePtr &physical_plan) {
   // DropTable is converted to a DropTable operator.
   execution_plan_->addRelationalOperator(
-      new DropTableOperator(physical_plan->catalog_relation()->getID()));
+      new DropTableOperator(*physical_plan->catalog_relation()));
 }
 
 void ExecutionGenerator::convertInsertTuple(
@@ -878,7 +879,7 @@
 
   const QueryPlan::DAGNodeIndex insert_operator_index =
       execution_plan_->addRelationalOperator(
-          new InsertOperator(input_relation->getID(),
+          new InsertOperator(*input_relation,
                              insert_destination_index,
                              tuple_index));
   insert_destination_proto->set_relational_op_index(insert_operator_index);
@@ -1073,7 +1074,7 @@
   const QueryPlan::DAGNodeIndex finalize_aggregation_operator_index =
       execution_plan_->addRelationalOperator(
           new FinalizeAggregationOperator(aggr_state_index,
-                                          output_relation->getID(),
+                                          *output_relation,
                                           insert_destination_index));
   insert_destination_proto->set_relational_op_index(finalize_aggregation_operator_index);
 
@@ -1122,7 +1123,7 @@
   const QueryPlan::DAGNodeIndex run_generator_index =
       execution_plan_->addRelationalOperator(
           new SortRunGenerationOperator(*input_relation_info->relation,
-                                        initial_runs_relation->getID(),
+                                        *initial_runs_relation,
                                         initial_runs_destination_id,
                                         sort_run_gen_config_id,
                                         input_relation_info->isStoredRelation()));
@@ -1175,7 +1176,7 @@
   const QueryPlan::DAGNodeIndex merge_run_operator_index =
       execution_plan_->addRelationalOperator(
           new SortMergeRunOperator(*initial_runs_relation,
-                                   sorted_relation->getID(),
+                                   *sorted_relation,
                                    sorted_output_destination_id,
                                    *merged_runs_relation,
                                    merged_runs_destination_id,
@@ -1197,7 +1198,7 @@
   const QueryPlan::DAGNodeIndex drop_merged_runs_index =
       execution_plan_->addRelationalOperator(
           new DropTableOperator(
-              merged_runs_relation->getID(),
+              *merged_runs_relation,
               false /* only_drop_blocks */));
   execution_plan_->addDirectDependency(
       drop_merged_runs_index,
diff --git a/relational_operators/CMakeLists.txt b/relational_operators/CMakeLists.txt
index 6e2d543..d6f4ae5 100644
--- a/relational_operators/CMakeLists.txt
+++ b/relational_operators/CMakeLists.txt
@@ -85,12 +85,9 @@
                       quickstep_storage_ValueAccessor
                       quickstep_utility_Macros)
 target_link_libraries(quickstep_relationaloperators_CreateTableOperator
-                      glog
                       quickstep_catalog_CatalogDatabase
                       quickstep_catalog_CatalogRelation
-                      quickstep_queryexecution_WorkOrdersContainer
                       quickstep_relationaloperators_RelationalOperator
-                      quickstep_relationaloperators_WorkOrder
                       quickstep_utility_Macros)
 target_link_libraries(quickstep_relationaloperators_DeleteOperator
                       glog
diff --git a/relational_operators/CreateTableOperator.cpp b/relational_operators/CreateTableOperator.cpp
index 2a6a94d..8e63937 100644
--- a/relational_operators/CreateTableOperator.cpp
+++ b/relational_operators/CreateTableOperator.cpp
@@ -1,6 +1,6 @@
 /**
  *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ *   Copyright 2015-2016 Pivotal Software, Inc.
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -20,27 +20,15 @@
 #include <memory>
 
 #include "catalog/CatalogDatabase.hpp"
-#include "query_execution/WorkOrdersContainer.hpp"
-
-#include "glog/logging.h"
 
 namespace quickstep {
 
 bool CreateTableOperator::getAllWorkOrders(WorkOrdersContainer *container) {
   if (!work_generated_) {
     work_generated_ = true;
-    container->addNormalWorkOrder(
-        new CreateTableWorkOrder(relation_.release()),
-        op_index_);
+    database_->addRelation(relation_.release());
   }
-  return work_generated_;
-}
-
-void CreateTableWorkOrder::execute(QueryContext *query_context,
-                                   CatalogDatabase *catalog_database,
-                                   StorageManager *storage_manager) {
-  DCHECK(catalog_database != nullptr);
-  catalog_database->addRelation(relation_.release());
+  return true;
 }
 
 }  // namespace quickstep
diff --git a/relational_operators/CreateTableOperator.hpp b/relational_operators/CreateTableOperator.hpp
index e767c7d..2db5c38 100644
--- a/relational_operators/CreateTableOperator.hpp
+++ b/relational_operators/CreateTableOperator.hpp
@@ -1,6 +1,6 @@
 /**
  *   Copyright 2011-2015 Quickstep Technologies LLC.
- *   Copyright 2015 Pivotal Software, Inc.
+ *   Copyright 2015-2016 Pivotal Software, Inc.
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
  *   you may not use this file except in compliance with the License.
@@ -22,14 +22,11 @@
 
 #include "catalog/CatalogRelation.hpp"
 #include "relational_operators/RelationalOperator.hpp"
-#include "relational_operators/WorkOrder.hpp"
 #include "utility/Macros.hpp"
 
 namespace quickstep {
 
 class CatalogDatabase;
-class QueryContext;
-class StorageManager;
 class WorkOrdersContainer;
 
 /** \addtogroup RelationalOperators
@@ -47,54 +44,30 @@
    * @param relation The relation to add. This CreateTableOperator owns
    *        relation until the WorkOrder it produces is successfully executed,
    *        at which point it is owned by database.
+   * @param database The database to add a relation to.
    **/
-  explicit CreateTableOperator(CatalogRelation *relation)
+  CreateTableOperator(CatalogRelation *relation,
+                      CatalogDatabase *database)
       : relation_(relation),
+        database_(database),
         work_generated_(false) {}
 
   ~CreateTableOperator() override {}
 
+  /**
+   * @note no WorkOrder generated for this operator.
+   **/
   bool getAllWorkOrders(WorkOrdersContainer *container) override;
 
  private:
   std::unique_ptr<CatalogRelation> relation_;
+  CatalogDatabase *database_;
+
   bool work_generated_;
 
   DISALLOW_COPY_AND_ASSIGN(CreateTableOperator);
 };
 
-/**
- * @brief A WorkOrder produced by CreateTableOperator.
- **/
-class CreateTableWorkOrder : public WorkOrder {
- public:
-  /**
-   * @brief Constructor.
-   *
-   * @param relation The relation to add. This class does NOT take ownership
-   *        of the passed-in pointer, and it must remain valid until after
-   *        execute() is called, at which point it is owned by catalog_database
-   *        in execute().
-   **/
-  explicit CreateTableWorkOrder(CatalogRelation *relation)
-      : relation_(relation) {}
-
-  ~CreateTableWorkOrder() override {}
-
-  /**
-   * @exception RelationNameCollision A relation with the same name is already
-   *            present in the database.
-   **/
-  void execute(QueryContext *query_context,
-               CatalogDatabase *catalog_database,
-               StorageManager *storage_manager) override;
-
- private:
-  std::unique_ptr<CatalogRelation> relation_;
-
-  DISALLOW_COPY_AND_ASSIGN(CreateTableWorkOrder);
-};
-
 /** @} */
 
 }  // namespace quickstep
diff --git a/relational_operators/DropTableOperator.cpp b/relational_operators/DropTableOperator.cpp
index 4fd6abc..15eed2b 100644
--- a/relational_operators/DropTableOperator.cpp
+++ b/relational_operators/DropTableOperator.cpp
@@ -33,7 +33,7 @@
   if (blocking_dependencies_met_ && !work_generated_) {
     work_generated_ = true;
     container->addNormalWorkOrder(
-        new DropTableWorkOrder(rel_id_, only_drop_blocks_),
+        new DropTableWorkOrder(relation_.getID(), only_drop_blocks_),
         op_index_);
   }
   return work_generated_;
diff --git a/relational_operators/DropTableOperator.hpp b/relational_operators/DropTableOperator.hpp
index 4c8cc53..975e96d 100644
--- a/relational_operators/DropTableOperator.hpp
+++ b/relational_operators/DropTableOperator.hpp
@@ -48,9 +48,9 @@
    * @param only_drop_blocks If true, only drop the blocks belonging to
    *        relation, but leave relation in the database.
    **/
-  explicit DropTableOperator(const relation_id rel_id,
+  explicit DropTableOperator(const CatalogRelation &relation,
                              const bool only_drop_blocks = false)
-      : rel_id_(rel_id),
+      : relation_(relation),
         only_drop_blocks_(only_drop_blocks),
         work_generated_(false) {}
 
@@ -59,7 +59,7 @@
   bool getAllWorkOrders(WorkOrdersContainer *container) override;
 
  private:
-  const relation_id rel_id_;
+  const CatalogRelation &relation_;
   const bool only_drop_blocks_;
   bool work_generated_;
 
@@ -74,7 +74,7 @@
   /**
    * @brief Constructor.
    *
-   * @param rel_id The id of the relation to drop.
+   * @param relation The relation to drop.
    * @param only_drop_blocks If true, only drop the blocks belonging to
    *        relation, but leave relation in the database.
    **/
diff --git a/relational_operators/FinalizeAggregationOperator.hpp b/relational_operators/FinalizeAggregationOperator.hpp
index cdb7e0e..65e34da 100644
--- a/relational_operators/FinalizeAggregationOperator.hpp
+++ b/relational_operators/FinalizeAggregationOperator.hpp
@@ -44,15 +44,15 @@
    * tuples.  The actual aggregation is computed by the AggregationOperator.
    *
    * @param aggr_state_index The index of the AggregationState in QueryContext.
-   * @param output_relation_id The id of the output relation.
+   * @param output_relation The output relation.
    * @param output_destination_index The index of the InsertDestination in the
    *        QueryContext to insert aggregation results.
    */
   FinalizeAggregationOperator(const QueryContext::aggregation_state_id aggr_state_index,
-                              const relation_id output_relation_id,
+                              const CatalogRelation &output_relation,
                               const QueryContext::insert_destination_id output_destination_index)
       : aggr_state_index_(aggr_state_index),
-        output_relation_id_(output_relation_id),
+        output_relation_(output_relation),
         output_destination_index_(output_destination_index),
         started_(false) {}
 
@@ -65,12 +65,12 @@
   }
 
   const relation_id getOutputRelationID() const override {
-    return output_relation_id_;
+    return output_relation_.getID();
   }
 
  private:
   const QueryContext::aggregation_state_id aggr_state_index_;
-  const relation_id output_relation_id_;
+  const CatalogRelation &output_relation_;
   const QueryContext::insert_destination_id output_destination_index_;
   bool started_;
 
diff --git a/relational_operators/HashJoinOperator.hpp b/relational_operators/HashJoinOperator.hpp
index ce1e2be..f258978 100644
--- a/relational_operators/HashJoinOperator.hpp
+++ b/relational_operators/HashJoinOperator.hpp
@@ -77,7 +77,7 @@
    * @param join_key_attributes The IDs of equijoin attributes in
    *        probe_relation.
    * @param any_join_key_attributes_nullable If any attribute is nullable.
-   * @param output_relation_id The id of the output relation.
+   * @param output_relation The output relation.
    * @param output_destination_index The index of the InsertDestination in the
    *        QueryContext to insert the join results.
    * @param hash_table_index The index of the JoinHashTable in QueryContext.
@@ -90,12 +90,12 @@
    *        output_relation_id. Each Scalar is evaluated for the joined tuples,
    *        and the resulting value is inserted into the join result.
    **/
-  HashJoinOperator(const CatalogRelationSchema &build_relation,
+  HashJoinOperator(const CatalogRelation &build_relation,
                    const CatalogRelation &probe_relation,
                    const bool probe_relation_is_stored,
                    const std::vector<attribute_id> &join_key_attributes,
                    const bool any_join_key_attributes_nullable,
-                   const relation_id output_relation_id,
+                   const CatalogRelation &output_relation,
                    const QueryContext::insert_destination_id output_destination_index,
                    const QueryContext::join_hash_table_id hash_table_index,
                    const QueryContext::predicate_id residual_predicate_index,
@@ -105,7 +105,7 @@
       probe_relation_is_stored_(probe_relation_is_stored),
       join_key_attributes_(join_key_attributes),
       any_join_key_attributes_nullable_(any_join_key_attributes_nullable),
-      output_relation_id_(output_relation_id),
+      output_relation_(output_relation),
       output_destination_index_(output_destination_index),
       hash_table_index_(hash_table_index),
       residual_predicate_index_(residual_predicate_index),
@@ -138,16 +138,25 @@
   }
 
   const relation_id getOutputRelationID() const override {
-    return output_relation_id_;
+    return output_relation_.getID();
+  }
+
+  void doneFeedingInputBlocks(const relation_id rel_id) override {
+    // The HashJoinOperator depends on BuildHashOperator too, but it
+    // should ignore a doneFeedingInputBlocks() message that comes
+    // after completion of BuildHashOperator. Therefore we need this check.
+    if (probe_relation_.getID() == rel_id) {
+      done_feeding_input_relation_ = true;
+    }
   }
 
  private:
-  const CatalogRelationSchema &build_relation_;
+  const CatalogRelation &build_relation_;
   const CatalogRelation &probe_relation_;
   const bool probe_relation_is_stored_;
   const std::vector<attribute_id> join_key_attributes_;
   const bool any_join_key_attributes_nullable_;
-  const relation_id output_relation_id_;
+  const CatalogRelation &output_relation_;
   const QueryContext::insert_destination_id output_destination_index_;
   const QueryContext::join_hash_table_id hash_table_index_;
   const QueryContext::predicate_id residual_predicate_index_;
diff --git a/relational_operators/InsertOperator.hpp b/relational_operators/InsertOperator.hpp
index dd39098..b9bd739 100644
--- a/relational_operators/InsertOperator.hpp
+++ b/relational_operators/InsertOperator.hpp
@@ -42,15 +42,15 @@
   /**
    * @brief Constructor.
    *
-   * @param output_relation_id The id of the output relation.
+   * @param output_relation_id The output relation.
    * @param output_destination_index The index of the InsertDestination in the
    *        QueryContext to insert the tuple.
    * @param tuple_index The index of the tuple to insert in the QueryContext.
    **/
-  InsertOperator(const relation_id output_relation_id,
+  InsertOperator(const CatalogRelation &output_relation,
                  const QueryContext::insert_destination_id output_destination_index,
                  const QueryContext::tuple_id tuple_index)
-      : output_relation_id_(output_relation_id),
+      : output_relation_(output_relation),
         output_destination_index_(output_destination_index),
         tuple_index_(tuple_index),
         work_generated_(false) {}
@@ -64,11 +64,11 @@
   }
 
   const relation_id getOutputRelationID() const override {
-    return output_relation_id_;
+    return output_relation_.getID();
   }
 
  private:
-  const relation_id output_relation_id_;
+  const CatalogRelation &output_relation_;
   const QueryContext::insert_destination_id output_destination_index_;
   const QueryContext::tuple_id tuple_index_;
   bool work_generated_;
diff --git a/relational_operators/NestedLoopsJoinOperator.hpp b/relational_operators/NestedLoopsJoinOperator.hpp
index 44c0da1..075a1f3 100644
--- a/relational_operators/NestedLoopsJoinOperator.hpp
+++ b/relational_operators/NestedLoopsJoinOperator.hpp
@@ -59,7 +59,7 @@
    *        actually important).
    * @param right_input_relation The second relation in the join (order is not
    *        actually important).
-   * @param output_relation_id The id of the output relation.
+   * @param output_relation The output relation.
    * @param output_destination_index The index of the InsertDestination in the
    *        QueryContext to insert the join results.
    * @param join_predicate_index The index of join predicate in QueryContext to
@@ -75,7 +75,7 @@
    **/
   NestedLoopsJoinOperator(const CatalogRelation &left_input_relation,
                           const CatalogRelation &right_input_relation,
-                          const relation_id output_relation_id,
+                          const CatalogRelation &output_relation,
                           const QueryContext::insert_destination_id output_destination_index,
                           const QueryContext::predicate_id join_predicate_index,
                           const QueryContext::scalar_group_id selection_index,
@@ -83,7 +83,7 @@
                           bool right_relation_is_stored)
       : left_input_relation_(left_input_relation),
         right_input_relation_(right_input_relation),
-        output_relation_id_(output_relation_id),
+        output_relation_(output_relation),
         output_destination_index_(output_destination_index),
         join_predicate_index_(join_predicate_index),
         selection_index_(selection_index),
@@ -124,7 +124,7 @@
   }
 
   const relation_id getOutputRelationID() const override {
-    return output_relation_id_;
+    return output_relation_.getID();
   }
 
  private:
@@ -168,7 +168,7 @@
   const CatalogRelation &left_input_relation_;
   const CatalogRelation &right_input_relation_;
 
-  const relation_id output_relation_id_;
+  const CatalogRelation &output_relation_;
   const QueryContext::insert_destination_id output_destination_index_;
 
   const QueryContext::predicate_id join_predicate_index_;
diff --git a/relational_operators/SelectOperator.hpp b/relational_operators/SelectOperator.hpp
index cebf1b2..e1a5e84 100644
--- a/relational_operators/SelectOperator.hpp
+++ b/relational_operators/SelectOperator.hpp
@@ -51,7 +51,7 @@
    *        list.
    *
    * @param input_relation The relation to perform selection over.
-   * @param output_relation_id The id of the output relation.
+   * @param output_relation The output relation.
    * @param output_destination_index The index of the InsertDestination in the
    *        QueryContext to insert the selection results.
    * @param predicate_index The index of selection predicate in QueryContext.
@@ -64,13 +64,13 @@
    *        workorders.
    **/
   SelectOperator(const CatalogRelation &input_relation,
-                 const relation_id output_relation_id,
+                 const CatalogRelation &output_relation,
                  const QueryContext::insert_destination_id output_destination_index,
                  const QueryContext::predicate_id predicate_index,
                  const QueryContext::scalar_group_id selection_index,
                  bool input_relation_is_stored)
       : input_relation_(input_relation),
-        output_relation_id_(output_relation_id),
+        output_relation_(output_relation),
         output_destination_index_(output_destination_index),
         predicate_index_(predicate_index),
         selection_index_(selection_index),
@@ -88,7 +88,7 @@
    * @note selection_index_ is invalid, and will not be used for projection.
    *
    * @param input_relation The relation to perform selection over.
-   * @param output_relation_id The id of the output relation.
+   * @param output_relation The output relation.
    * @param output_destination_index The index of the InsertDestination in the
    *        QueryContext to insert the selection results.
    * @param selection A projection list of attribute IDs. The operator takes
@@ -101,13 +101,13 @@
    *        workorders.
    **/
   SelectOperator(const CatalogRelation &input_relation,
-                 const relation_id output_relation_id,
+                 const CatalogRelation &output_relation,
                  const QueryContext::insert_destination_id output_destination_index,
                  const QueryContext::predicate_id predicate_index,
                  std::vector<attribute_id> *selection,
                  bool input_relation_is_stored)
       : input_relation_(input_relation),
-        output_relation_id_(output_relation_id),
+        output_relation_(output_relation),
         output_destination_index_(output_destination_index),
         predicate_index_(predicate_index),
         selection_index_(QueryContext::kInvalidScalarGroupId),
@@ -138,13 +138,13 @@
   }
 
   const relation_id getOutputRelationID() const override {
-    return output_relation_id_;
+    return output_relation_.getID();
   }
 
  private:
-  const CatalogRelationSchema &input_relation_;
+  const CatalogRelation &input_relation_;
 
-  const relation_id output_relation_id_;
+  const CatalogRelation &output_relation_;
   const QueryContext::insert_destination_id output_destination_index_;
   const QueryContext::predicate_id predicate_index_;
 
diff --git a/relational_operators/SortMergeRunOperator.hpp b/relational_operators/SortMergeRunOperator.hpp
index fe77db4..7394d1b 100644
--- a/relational_operators/SortMergeRunOperator.hpp
+++ b/relational_operators/SortMergeRunOperator.hpp
@@ -71,7 +71,7 @@
    * @brief Constructor for merging sorted runs to generate a sorted relation.
    *
    * @param input_relation The relation to merge sorted blocks.
-   * @param output_relation_id The id of the output relation.
+   * @param output_relation The output relation.
    * @param output_destination_index The index of the InsertDestination in the
    *        QueryContext to store the sorted blocks in.
    * @param run_relation The temporary relation used to store intermediate runs
@@ -90,7 +90,7 @@
    * @param bus A pointer to the TMB.
    **/
   SortMergeRunOperator(const CatalogRelation &input_relation,
-                       const relation_id output_relation_id,
+                       const CatalogRelation &output_relation,
                        const QueryContext::insert_destination_id output_destination_index,
                        const CatalogRelation &run_relation,
                        const QueryContext::insert_destination_id run_block_destination_index,
@@ -101,7 +101,7 @@
                        const tmb::client_id foreman_client_id,
                        tmb::MessageBus *bus)
       : input_relation_(input_relation),
-        output_relation_id_(output_relation_id),
+        output_relation_(output_relation),
         output_destination_index_(output_destination_index),
         sort_config_index_(sort_config_index),
         merge_factor_(merge_factor),
@@ -156,7 +156,7 @@
   }
 
   const relation_id getOutputRelationID() const override {
-    return output_relation_id_;
+    return output_relation_.getID();
   }
 
  private:
@@ -172,7 +172,7 @@
 
   const CatalogRelation &input_relation_;
 
-  const relation_id output_relation_id_;
+  const CatalogRelation &output_relation_;
   const QueryContext::insert_destination_id output_destination_index_;
 
   const QueryContext::sort_config_id sort_config_index_;
diff --git a/relational_operators/SortRunGenerationOperator.hpp b/relational_operators/SortRunGenerationOperator.hpp
index d77bd54..3d7873a 100644
--- a/relational_operators/SortRunGenerationOperator.hpp
+++ b/relational_operators/SortRunGenerationOperator.hpp
@@ -68,7 +68,7 @@
    * configuration and writing to output destination.
    *
    * @param input_relation The relation to generate sorted runs of.
-   * @param output_relation_id The id of the output relation.
+   * @param output_relation The output relation.
    * @param output_destination_index The index of the InsertDestination in the
    *        QueryContext to store the sorted blocks of runs.
    * @param sort_config Sort configuration specifying ORDER BY, ordering and
@@ -79,12 +79,12 @@
    *                                 streamed.
    **/
   SortRunGenerationOperator(const CatalogRelation &input_relation,
-                            const relation_id output_relation_id,
+                            const CatalogRelation &output_relation,
                             const QueryContext::insert_destination_id output_destination_index,
                             const QueryContext::sort_config_id sort_config_index,
                             bool input_relation_is_stored)
       : input_relation_(input_relation),
-        output_relation_id_(output_relation_id),
+        output_relation_(output_relation),
         output_destination_index_(output_destination_index),
         sort_config_index_(sort_config_index),
         input_relation_block_ids_(input_relation_is_stored ? input_relation.getBlocksSnapshot()
@@ -114,13 +114,13 @@
   }
 
   const relation_id getOutputRelationID() const override {
-    return output_relation_id_;
+    return output_relation_.getID();
   }
 
  private:
   const CatalogRelation &input_relation_;
 
-  const relation_id output_relation_id_;
+  const CatalogRelation &output_relation_;
   const QueryContext::insert_destination_id output_destination_index_;
 
   const QueryContext::sort_config_id sort_config_index_;
diff --git a/relational_operators/TextScanOperator.hpp b/relational_operators/TextScanOperator.hpp
index 3d5a8d5..21d2095 100644
--- a/relational_operators/TextScanOperator.hpp
+++ b/relational_operators/TextScanOperator.hpp
@@ -128,7 +128,7 @@
    *        text file.
    * @param parallelize_load Parallelize the load process by th spliting file
    *        into blobs, and generating separate work-orders for each of them.
-   * @param output_relation_id The id of the output relation.
+   * @param output_relation The output relation.
    * @param output_destination_index The index of the InsertDestination in the
    *        QueryContext to insert tuples.
    * @param foreman_client_id The TMB client ID of the Foreman thread.
@@ -138,7 +138,7 @@
                    const char field_terminator,
                    const bool process_escape_sequences,
                    const bool parallelize_load,
-                   const relation_id output_relation_id,
+                   const CatalogRelation &output_relation,
                    const QueryContext::insert_destination_id output_destination_index,
                    const tmb::client_id foreman_client_id,
                    tmb::MessageBus *bus)
@@ -146,7 +146,7 @@
         field_terminator_(field_terminator),
         process_escape_sequences_(process_escape_sequences),
         parallelize_load_(parallelize_load),
-        output_relation_id_(output_relation_id),
+        output_relation_(output_relation),
         output_destination_index_(output_destination_index),
         foreman_client_id_(foreman_client_id),
         bus_(bus),
@@ -163,7 +163,7 @@
   }
 
   const relation_id getOutputRelationID() const override {
-    return output_relation_id_;
+    return output_relation_.getID();
   }
 
   void receiveFeedbackMessage(const WorkOrder::FeedbackMessage &msg) override;
@@ -174,7 +174,7 @@
   const bool process_escape_sequences_;
   const bool parallelize_load_;
 
-  const relation_id output_relation_id_;
+  const CatalogRelation &output_relation_;
   const QueryContext::insert_destination_id output_destination_index_;
 
   const tmb::client_id foreman_client_id_;
diff --git a/relational_operators/tests/AggregationOperator_unittest.cpp b/relational_operators/tests/AggregationOperator_unittest.cpp
index 42b91f2..5af210c 100644
--- a/relational_operators/tests/AggregationOperator_unittest.cpp
+++ b/relational_operators/tests/AggregationOperator_unittest.cpp
@@ -239,21 +239,19 @@
     // Create Operators.
     op_.reset(new AggregationOperator(*table_, true, aggr_state_index));
 
-    const relation_id output_relation_id = result_table_->getID();
-
     // Setup the InsertDestination proto in the query context proto.
     const QueryContext::insert_destination_id insert_destination_index =
         query_context_proto.insert_destinations_size();
     serialization::InsertDestination *insert_destination_proto = query_context_proto.add_insert_destinations();
 
     insert_destination_proto->set_insert_destination_type(serialization::InsertDestinationType::BLOCK_POOL);
-    insert_destination_proto->set_relation_id(output_relation_id);
+    insert_destination_proto->set_relation_id(result_table_->getID());
     insert_destination_proto->set_need_to_add_blocks_from_relation(false);
     insert_destination_proto->set_relational_op_index(kOpIndex);
     insert_destination_proto->set_foreman_client_id(tmb::kClientIdNone);
 
     finalize_op_.reset(
-        new FinalizeAggregationOperator(aggr_state_index, output_relation_id, insert_destination_index));
+        new FinalizeAggregationOperator(aggr_state_index, *result_table_, insert_destination_index));
 
     // Set up the QueryContext.
     query_context_.reset(new QueryContext(query_context_proto, db_.get(), storage_manager_.get(), nullptr /* TMB */));
@@ -319,21 +317,19 @@
     // Create Operators.
     op_.reset(new AggregationOperator(*table_, true, aggr_state_index));
 
-    const relation_id output_relation_id = result_table_->getID();
-
     // Setup the InsertDestination proto in the query context proto.
     const QueryContext::insert_destination_id insert_destination_index =
         query_context_proto.insert_destinations_size();
     serialization::InsertDestination *insert_destination_proto = query_context_proto.add_insert_destinations();
 
     insert_destination_proto->set_insert_destination_type(serialization::InsertDestinationType::BLOCK_POOL);
-    insert_destination_proto->set_relation_id(output_relation_id);
+    insert_destination_proto->set_relation_id(result_table_->getID());
     insert_destination_proto->set_need_to_add_blocks_from_relation(false);
     insert_destination_proto->set_relational_op_index(kOpIndex);
     insert_destination_proto->set_foreman_client_id(tmb::kClientIdNone);
 
     finalize_op_.reset(
-        new FinalizeAggregationOperator(aggr_state_index, output_relation_id, insert_destination_index));
+        new FinalizeAggregationOperator(aggr_state_index, *result_table_, insert_destination_index));
 
     // Set up the QueryContext.
     query_context_.reset(new QueryContext(query_context_proto, db_.get(), storage_manager_.get(), nullptr /* TMB */));
diff --git a/relational_operators/tests/HashJoinOperator_unittest.cpp b/relational_operators/tests/HashJoinOperator_unittest.cpp
index babea1a..ac088f0 100644
--- a/relational_operators/tests/HashJoinOperator_unittest.cpp
+++ b/relational_operators/tests/HashJoinOperator_unittest.cpp
@@ -322,7 +322,7 @@
                            true /* is_stored */,
                            std::vector<attribute_id>(1, fact_col_long.getID()),
                            fact_col_long.getType().isNullable(),
-                           output_relation_id,
+                           *result_table,
                            output_destination_index,
                            join_hash_table_index,
                            QueryContext::kInvalidPredicateId /* residual_predicate_index */,
@@ -462,7 +462,7 @@
                            true /* is_stored */,
                            std::vector<attribute_id>(1, fact_col_int.getID()),
                            fact_col_int.getType().isNullable(),
-                           output_relation_id,
+                           *result_table,
                            output_destination_index,
                            join_hash_table_index,
                            QueryContext::kInvalidPredicateId /* residual_predicate_index */,
@@ -610,7 +610,7 @@
                            true /* is_stored */,
                            std::vector<attribute_id>(1, fact_col_char.getID()),
                            fact_col_char.getType().isNullable(),
-                           output_relation_id,
+                           *result_table,
                            output_destination_index,
                            join_hash_table_index,
                            QueryContext::kInvalidPredicateId /* residual_predicate_index */,
@@ -743,7 +743,7 @@
                            true /* is_stored */,
                            std::vector<attribute_id>(1, fact_col_varchar.getID()),
                            fact_col_varchar.getType().isNullable(),
-                           output_relation_id,
+                           *result_table,
                            output_destination_index,
                            join_hash_table_index,
                            QueryContext::kInvalidPredicateId /* residual_predicate_index */,
@@ -910,7 +910,7 @@
                            true /* is_stored */,
                            fact_key_attrs,
                            fact_col_long.getType().isNullable() || fact_col_varchar.getType().isNullable(),
-                           output_relation_id,
+                           *result_table,
                            output_destination_index,
                            join_hash_table_index,
                            QueryContext::kInvalidPredicateId /* residual_predicate_index */,
@@ -1088,7 +1088,7 @@
                            true /* is_stored */,
                            fact_key_attrs,
                            fact_col_long.getType().isNullable() || fact_col_varchar.getType().isNullable(),
-                           output_relation_id,
+                           *result_table,
                            output_destination_index,
                            join_hash_table_index,
                            residual_pred_index,
diff --git a/relational_operators/tests/SortMergeRunOperator_unittest.cpp b/relational_operators/tests/SortMergeRunOperator_unittest.cpp
index 563346b..8890697 100644
--- a/relational_operators/tests/SortMergeRunOperator_unittest.cpp
+++ b/relational_operators/tests/SortMergeRunOperator_unittest.cpp
@@ -1487,7 +1487,7 @@
     const QueryContext::sort_config_id sort_config_index = createSortConfigProto(attrs, ordering, null_ordering);
 
     merge_op_.reset(new SortMergeRunOperator(*input_table_,
-                                             result_table_->getID(),
+                                             *result_table_,
                                              insert_destination_index_,
                                              *run_table_,
                                              run_destination_index_,
@@ -1528,7 +1528,7 @@
     const QueryContext::sort_config_id sort_config_index = createSortConfigProto(attrs, ordering, null_ordering);
 
     merge_op_.reset(new SortMergeRunOperator(*input_table_,
-                                             result_table_->getID(),
+                                             *result_table_,
                                              insert_destination_index_,
                                              *run_table_,
                                              run_destination_index_,
diff --git a/relational_operators/tests/SortRunGenerationOperator_unittest.cpp b/relational_operators/tests/SortRunGenerationOperator_unittest.cpp
index 04271c2..62e0476 100644
--- a/relational_operators/tests/SortRunGenerationOperator_unittest.cpp
+++ b/relational_operators/tests/SortRunGenerationOperator_unittest.cpp
@@ -288,8 +288,6 @@
   void executeSort(const std::vector<attribute_id> &attrs,
                    const std::vector<bool> &ordering,
                    const std::vector<bool> &null_ordering) {
-    const relation_id output_relation_id = result_table_->getID();
-
     // Setup the InsertDestination proto in the query context proto.
     serialization::QueryContext query_context_proto;
 
@@ -298,7 +296,7 @@
     serialization::InsertDestination *insert_destination_proto = query_context_proto.add_insert_destinations();
 
     insert_destination_proto->set_insert_destination_type(serialization::InsertDestinationType::BLOCK_POOL);
-    insert_destination_proto->set_relation_id(output_relation_id);
+    insert_destination_proto->set_relation_id(result_table_->getID());
     insert_destination_proto->set_need_to_add_blocks_from_relation(false);
     insert_destination_proto->set_relational_op_index(kOpIndex);
     insert_destination_proto->set_foreman_client_id(thread_client_id_);
@@ -322,7 +320,7 @@
 
     std::unique_ptr<RelationalOperator> run_gen(
         new SortRunGenerationOperator(*input_table_,
-                                      output_relation_id,
+                                      *result_table_,
                                       insert_destination_index,
                                       sort_config_index,
                                       true /* is_stored */));
diff --git a/relational_operators/tests/TextScanOperator_unittest.cpp b/relational_operators/tests/TextScanOperator_unittest.cpp
index 22bf7e4..c379046 100644
--- a/relational_operators/tests/TextScanOperator_unittest.cpp
+++ b/relational_operators/tests/TextScanOperator_unittest.cpp
@@ -131,8 +131,6 @@
 TEST_F(TextScanOperatorTest, ScanTest) {
   std::string golden_string = LoadGoldenOutput();
 
-  const relation_id output_relation_id = relation_->getID();
-
   // Setup the InsertDestination proto in the query context proto.
   serialization::QueryContext query_context_proto;
 
@@ -140,7 +138,7 @@
   serialization::InsertDestination *output_destination_proto = query_context_proto.add_insert_destinations();
 
   output_destination_proto->set_insert_destination_type(serialization::InsertDestinationType::BLOCK_POOL);
-  output_destination_proto->set_relation_id(output_relation_id);
+  output_destination_proto->set_relation_id(relation_->getID());
   output_destination_proto->set_need_to_add_blocks_from_relation(false);
   output_destination_proto->set_relational_op_index(kOpIndex);
   output_destination_proto->set_foreman_client_id(tmb::kClientIdNone);
@@ -150,7 +148,7 @@
                            '\t',
                            true,
                            false,
-                           output_relation_id,
+                           *relation_,
                            output_destination_index,
                            tmb::kClientIdNone /* foreman_client_id */,
                            nullptr /* TMB */));