[PATCH 1/3 v2] sql: store CHAR|VARCHAR len as integer, not type_def

Roman Khabibov roman.habibov at tarantool.org
Wed Dec 5 02:47:28 MSK 2018


From: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>

Length is just an integer, part of a type, not a
whole type.
---
 src/box/sql/parse.y | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/box/sql/parse.y b/src/box/sql/parse.y
index 6dfc81f70..5f64bfe8c 100644
--- a/src/box/sql/parse.y
+++ b/src/box/sql/parse.y
@@ -1485,13 +1485,13 @@ typedef(A) ::= DATE . { A.type = AFFINITY_REAL; }
 typedef(A) ::= TIME . { A.type = AFFINITY_REAL; }
 typedef(A) ::= DATETIME . { A.type = AFFINITY_REAL; }
 
-%type char_len_typedef {struct type_def}
-typedef(A) ::= CHAR|VARCHAR char_len_typedef(B) . {
+%type char_len {int}
+typedef(A) ::= CHAR|VARCHAR char_len(B) . {
   A.type = AFFINITY_TEXT;
   (void) B;
 }
 
-char_len_typedef(A) ::= LP INTEGER(B) RP . {
+char_len(A) ::= LP INTEGER(B) RP . {
   (void) A;
   (void) B;
 }
-- 
2.19.1




More information about the Tarantool-patches mailing list