Procházet zdrojové kódy

fix: add mva as synonym to multi (#4051)

* fix: add mva as synonym to multi

Historically multi-value attributes were
displayed as 'mva' or 'mva64'. However, everywhere else they were
'multi' and 'multi64'; especially when creating a table in RT mode.
To avoid confusion, let's add 'mva' and 'mva64' as synonyms to 'multi'
and 'multi64'. That breaks nothing.

ref #2281
Aleksey N. Vinogradov před 2 měsíci
rodič
revize
a1fea519cb

+ 2 - 0
src/ddl.l

@@ -90,7 +90,9 @@
 "MODIFY"			{ YYSTOREBOUNDS; return TOK_MODIFY; }
 "MODIFY"[ \t\n\r]+"COLUMN" { return TOK_MODIFY_COLUMN; }
 "MULTI"				{ YYSTOREBOUNDS; return TOK_MULTI; }
+"MVA"				{ YYSTOREBOUNDS; return TOK_MVA; }
 "MULTI64"			{ YYSTOREBOUNDS; return TOK_MULTI64; }
+"MVA64" 			{ YYSTOREBOUNDS; return TOK_MVA64; }
 "NOT"				{ YYSTOREBOUNDS; return TOK_NOT; }
 "OPTION"			{ YYSTOREBOUNDS; return TOK_OPTION; }
 "PLUGIN"			{ YYSTOREBOUNDS; return TOK_PLUGIN; }

+ 6 - 0
src/ddl.y

@@ -66,6 +66,8 @@
 %token	TOK_MODIFY_COLUMN
 %token	TOK_MULTI
 %token	TOK_MULTI64
+%token	TOK_MVA "mva"
+%token	TOK_MVA64 "mva64"
 %token	TOK_NOT
 %token	TOK_OPTION
 %token	TOK_PLUGIN
@@ -112,6 +114,8 @@ tableident:
 	| TOK_MODIFY
     | TOK_TYPE
     | TOK_ENGINE
+    | TOK_MVA
+    | TOK_MVA64
 	;
 
 ident:
@@ -131,6 +135,8 @@ attribute_type:
 	| TOK_BOOL		{ $$.SetValueInt ( SPH_ATTR_BOOL ); }
 	| TOK_MULTI		{ $$.SetValueInt ( SPH_ATTR_UINT32SET ); }
 	| TOK_MULTI64	{ $$.SetValueInt ( SPH_ATTR_INT64SET ); }
+	| TOK_MVA		{ $$.SetValueInt ( SPH_ATTR_UINT32SET ); }
+    | TOK_MVA64		{ $$.SetValueInt ( SPH_ATTR_INT64SET ); }
 	| TOK_JSON		{ $$.SetValueInt ( SPH_ATTR_JSON ); }
 	| TOK_INT		{ $$.SetValueInt ( SPH_ATTR_INTEGER ); }
 	| TOK_UINT		{ $$.SetValueInt ( SPH_ATTR_INTEGER ); }

+ 1 - 1
test/clt-tests/core/test-alter-table-distributed.rec

@@ -81,7 +81,7 @@ ERROR 1064 (42000) at line 1: P03: syntax error, unexpected $undefined, expectin
 ––– input –––
 mysql -h0 -P9306 -e "ALTER TABLE @name local='index201' local='index204';"
 ––– output –––
-ERROR 1064 (42000) at line 1: P03: syntax error, unexpected identifier, expecting tablename or ENGINE or MODIFY or TYPE near '@name local='index201' local='index204''
+ERROR 1064 (42000) at line 1: P03: syntax error, unexpected identifier near '@name local='index201' local='index204''
 ––– input –––
 mysql -h0 -P9306 -e "DESC products"
 ––– output –––

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 1
test/test_363/model.bin


+ 4 - 0
test/test_363/test.xml

@@ -21,10 +21,14 @@ searchd
 	<sphinxql>
 		create table t(i int, f float, s string, t text, b bigint, j json, m multi, m64 multi64, bl bool);
 		desc t;
+		create table tmva(i int, f float, s string, t text, b bigint, j json, m mva, m64 mva64, bl bool);
+		desc tmva;
 	</sphinxql>
 	<query endpoint="cli_json" method="post">select * from t</query>
+	<query endpoint="cli_json" method="post">select * from tmva</query>
 	<sphinxql>
 		drop table t;
+		drop table tmva;
 	</sphinxql>
 </queries>
 

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů