Skip to content

Commit

Permalink
Fulltext bugs (#21055)
Browse files Browse the repository at this point in the history
bug fix tokenizer bug and show create table with index name.

Approved by: @badboynt1, @sukki37, @aressu1985, @ouyuanning, @heni02
  • Loading branch information
cpegeric authored Jan 6, 2025
1 parent 34d86cc commit 8476083
Show file tree
Hide file tree
Showing 14 changed files with 96 additions and 45 deletions.
12 changes: 11 additions & 1 deletion pkg/monlp/tokenizer/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,19 @@ func (t *SimpleTokenizer) outputLatin(pos int, yield func(Token) bool) {
bs = t.input[t.begin:pos]
} else {
if t.input[t.begin+MAX_TOKEN_SIZE-1] <= 127 {
// last character is ascii
bs = t.input[t.begin : t.begin+MAX_TOKEN_SIZE]
} else {
bs = t.input[t.begin : t.begin+MAX_TOKEN_SIZE-1]
// find the leading byte
n := 1
for i := 0; i < 4; i++ {
// leading byte must have value at least 192 (binary 11000000)
if t.input[t.begin+MAX_TOKEN_SIZE-i-1] >= 192 {
break
}
n++
}
bs = t.input[t.begin : t.begin+MAX_TOKEN_SIZE-n]
}
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/monlp/tokenizer/simple_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ func TestLatin(t *testing.T) {
makeToken("long", 5),
makeToken("word", 6),
})
checkTokenize(t, "Pадіоаматорів", []Token{
makeToken("pадіоаматор", 0),
})
}

func TestCJK(t *testing.T) {
Expand Down
24 changes: 14 additions & 10 deletions pkg/sql/plan/apply_indices.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,32 +71,36 @@ func isRuntimeConstExpr(expr *plan.Expr) bool {
}
}

func (builder *QueryBuilder) applyIndices(nodeID int32, colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) int32 {
func (builder *QueryBuilder) applyIndices(nodeID int32, colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) (int32, error) {
var err error

if builder.optimizerHints != nil && builder.optimizerHints.applyIndices != 0 {
return nodeID
return nodeID, nil
}

node := builder.qry.Nodes[nodeID]
for i, childID := range node.Children {
node.Children[i] = builder.applyIndices(childID, colRefCnt, idxColMap)
node.Children[i], err = builder.applyIndices(childID, colRefCnt, idxColMap)
if err != nil {
return -1, err
}
}
replaceColumnsForNode(node, idxColMap)

switch node.NodeType {
case plan.Node_TABLE_SCAN:
return builder.applyIndicesForFilters(nodeID, node, colRefCnt, idxColMap)
return builder.applyIndicesForFilters(nodeID, node, colRefCnt, idxColMap), nil

case plan.Node_JOIN:
return builder.applyIndicesForJoins(nodeID, node, colRefCnt, idxColMap)
return builder.applyIndicesForJoins(nodeID, node, colRefCnt, idxColMap), nil

case plan.Node_PROJECT:
//NOTE: This is the entry point for vector index rule on SORT NODE.
return builder.applyIndicesForProject(nodeID, node, colRefCnt, idxColMap)

}

return nodeID
return nodeID, nil
}

func (builder *QueryBuilder) applyIndicesForFilters(nodeID int32, node *plan.Node,
Expand Down Expand Up @@ -173,7 +177,7 @@ func getColSeqFromColDef(tblCol *plan.ColDef) string {
return fmt.Sprintf("%d", tblCol.GetSeqnum())
}

func (builder *QueryBuilder) applyIndicesForProject(nodeID int32, projNode *plan.Node, colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) int32 {
func (builder *QueryBuilder) applyIndicesForProject(nodeID int32, projNode *plan.Node, colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) (int32, error) {
// FullText
{
// support the followings:
Expand Down Expand Up @@ -261,7 +265,7 @@ func (builder *QueryBuilder) applyIndicesForProject(nodeID int32, projNode *plan
}
}
if len(multiTableIndexes) == 0 {
return nodeID
return nodeID, nil
}

//1.b if sortNode has more than one order by, skip
Expand Down Expand Up @@ -344,15 +348,15 @@ func (builder *QueryBuilder) applyIndicesForProject(nodeID int32, projNode *plan
projNode.Children[0] = newSortNode
replaceColumnsForNode(projNode, idxColMap)

return newSortNode
return newSortNode, nil
}
END0:
// 2. Regular Index Check
{

}

return nodeID
return nodeID, nil
}

func (builder *QueryBuilder) applyIndicesForFiltersRegularIndex(nodeID int32, node *plan.Node, colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) int32 {
Expand Down
27 changes: 17 additions & 10 deletions pkg/sql/plan/apply_indices_fulltext.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,18 @@ import (
// +------------------------------------------------------------------------------------------+
func (builder *QueryBuilder) applyIndicesForProjectionUsingFullTextIndex(nodeID int32, projNode *plan.Node, sortNode *plan.Node, scanNode *plan.Node,
filterids []int32, filterIndexDefs []*plan.IndexDef, projids []int32, projIndexDef []*plan.IndexDef,
colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) int32 {
colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) (int32, error) {

ctx := builder.ctxByNode[nodeID]

// check equal fulltext_match func and only compute once for equal function()
eqmap := builder.findEqualFullTextMatchFunc(projNode, scanNode, projids, filterids)

idxID, filter_node_ids, proj_node_ids := builder.applyJoinFullTextIndices(nodeID, projNode, scanNode,
idxID, filter_node_ids, proj_node_ids, err := builder.applyJoinFullTextIndices(nodeID, projNode, scanNode,
filterids, filterIndexDefs, projids, projIndexDef, eqmap, colRefCnt, idxColMap)
if err != nil {
return -1, err
}

if sortNode != nil {
sortNode.Children[0] = idxID
Expand Down Expand Up @@ -131,7 +134,7 @@ func (builder *QueryBuilder) applyIndicesForProjectionUsingFullTextIndex(nodeID
},
}
}
return nodeID
return nodeID, nil
}

// mysql> explain select count(*) from src where match(title, body) against('d');
Expand All @@ -150,25 +153,29 @@ func (builder *QueryBuilder) applyIndicesForProjectionUsingFullTextIndex(nodeID
// +----------------------------------------------------------------+
func (builder *QueryBuilder) applyIndicesForAggUsingFullTextIndex(nodeID int32, projNode *plan.Node, aggNode *plan.Node, scanNode *plan.Node,
filterids []int32, filterIndexDefs []*plan.IndexDef,
colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) int32 {
colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) (int32, error) {
var err error

projids := make([]int32, 0)
projIndexDefs := make([]*plan.IndexDef, 0)

eqmap := make(map[int32]int32)

idxID, _, _ := builder.applyJoinFullTextIndices(nodeID, projNode, scanNode,
idxID, _, _, err := builder.applyJoinFullTextIndices(nodeID, projNode, scanNode,
filterids, filterIndexDefs, projids, projIndexDefs, eqmap, colRefCnt, idxColMap)
if err != nil {
return -1, err
}

aggNode.Children[0] = idxID

return nodeID
return nodeID, nil
}

func (builder *QueryBuilder) applyJoinFullTextIndices(nodeID int32, projNode *plan.Node, scanNode *plan.Node,
filterids []int32, filter_indexDefs []*plan.IndexDef,
projids []int32, proj_indexDefs []*plan.IndexDef, eqmap map[int32]int32,
colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) (int32, []int32, []int32) {
colRefCnt map[[2]int32]int, idxColMap map[[2]int32]*plan.Expr) (int32, []int32, []int32, error) {

ctx := builder.ctxByNode[nodeID]

Expand Down Expand Up @@ -264,7 +271,7 @@ func (builder *QueryBuilder) applyJoinFullTextIndices(nodeID int32, projNode *pl

curr_ftnode_id, err := builder.buildTable(tmpTableFunc, ctx, -1, nil)
if err != nil {
panic(err.Error())
return -1, nil, nil, err
}

// save the created fulltext node to either filter or projection
Expand All @@ -283,7 +290,7 @@ func (builder *QueryBuilder) applyJoinFullTextIndices(nodeID int32, projNode *pl
ret_proj_node_ids[v] = curr_ftnode_id

} else {
panic(moerr.NewInternalError(builder.GetContext(), "Invalid ret_proj_node_ids_map"))
return -1, nil, nil, moerr.NewInternalError(builder.GetContext(), "Invalid ret_proj_node_ids_map")
}
}

Expand Down Expand Up @@ -368,7 +375,7 @@ func (builder *QueryBuilder) applyJoinFullTextIndices(nodeID int32, projNode *pl
scanNode.Limit = nil
scanNode.Offset = nil

return joinnodeID, ret_filter_node_ids, ret_proj_node_ids
return joinnodeID, ret_filter_node_ids, ret_proj_node_ids, nil
}

func (builder *QueryBuilder) equalsFullTextMatchFunc(fn1 *plan.Function, fn2 *plan.Function) bool {
Expand Down
2 changes: 2 additions & 0 deletions pkg/sql/plan/build_ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -2657,6 +2657,8 @@ func buildTruncateTable(stmt *tree.TruncateTable, ctx CompilerContext) (*Plan, e
}
} else if indexdef.TableExist && catalog.IsMasterIndexAlgo(indexdef.IndexAlgo) {
truncateTable.IndexTableNames = append(truncateTable.IndexTableNames, indexdef.IndexTableName)
} else if indexdef.TableExist && catalog.IsFullTextIndexAlgo(indexdef.IndexAlgo) {
truncateTable.IndexTableNames = append(truncateTable.IndexTableNames, indexdef.IndexTableName)
}
}
}
Expand Down
7 changes: 6 additions & 1 deletion pkg/sql/plan/build_show_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,12 @@ func ConstructCreateTableSQL(ctx CompilerContext, tableDef *plan.TableDef, snaps

var indexStr string
if !indexdef.Unique && catalog.IsFullTextIndexAlgo(indexdef.IndexAlgo) {
indexStr += " FULLTEXT("
indexStr += " FULLTEXT "

if len(indexdef.IndexName) > 0 {
indexStr += fmt.Sprintf("`%s`", formatStr(indexdef.IndexName))
}
indexStr += "("
i := 0
for _, part := range indexdef.Parts {
if catalog.IsAlias(part) {
Expand Down
12 changes: 11 additions & 1 deletion pkg/sql/plan/build_show_util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,17 @@ func Test_buildTestShowCreateTable(t *testing.T) {
PRIMARY KEY (id),
FULLTEXT(json1) WITH PARSER json,
FULLTEXT(json1,json2) WITH PARSER json)`,
want: "CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` json DEFAULT NULL,\n `json2` json DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT(`json1`) WITH PARSER json,\n FULLTEXT(`json1`,`json2`) WITH PARSER json\n)",
want: "CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` json DEFAULT NULL,\n `json2` json DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT (`json1`) WITH PARSER json,\n FULLTEXT (`json1`,`json2`) WITH PARSER json\n)",
},
{
name: "test8",
sql: `CREATE TABLE src (id bigint NOT NULL,
json1 json DEFAULT NULL,
json2 json DEFAULT NULL,
PRIMARY KEY (id),
FULLTEXT idx01(json1) WITH PARSER json,
FULLTEXT idx02(json1,json2) WITH PARSER json)`,
want: "CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` json DEFAULT NULL,\n `json2` json DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT `idx01`(`json1`) WITH PARSER json,\n FULLTEXT `idx02`(`json1`,`json2`) WITH PARSER json\n)",
},
}
for _, tt := range tests {
Expand Down
10 changes: 7 additions & 3 deletions pkg/sql/plan/query_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1871,6 +1871,7 @@ func (builder *QueryBuilder) removeUnnecessaryProjections(nodeID int32) int32 {
}

func (builder *QueryBuilder) createQuery() (*Query, error) {
var err error
colRefBool := make(map[[2]int32]bool)
sinkColRef := make(map[[2]int32]int)

Expand Down Expand Up @@ -1925,7 +1926,10 @@ func (builder *QueryBuilder) createQuery() (*Query, error) {
}
// after determine shuffle, be careful when calling ReCalcNodeStats again.
// needResetHashMapStats should always be false from here
rootID = builder.applyIndices(rootID, colRefCnt, make(map[[2]int32]*plan.Expr))
rootID, err = builder.applyIndices(rootID, colRefCnt, make(map[[2]int32]*plan.Expr))
if err != nil {
return nil, err
}
ReCalcNodeStats(rootID, builder, true, false, false)

builder.generateRuntimeFilters(rootID)
Expand Down Expand Up @@ -1969,14 +1973,14 @@ func (builder *QueryBuilder) createQuery() (*Query, error) {
colRefCnt[[2]int32{resultTag, int32(j)}] = 1
}
}
_, err := builder.remapAllColRefs(rootID, int32(i), colRefCnt, colRefBool, sinkColRef)
_, err = builder.remapAllColRefs(rootID, int32(i), colRefCnt, colRefBool, sinkColRef)
if err != nil {
return nil, err
}
builder.qry.Steps[i] = builder.removeUnnecessaryProjections(rootID)
}

err := builder.lockTableIfLockNoRowsAtTheEndForDelAndUpdate()
err = builder.lockTableIfLockNoRowsAtTheEndForDelAndUpdate()
if err != nil {
return nil, err
}
Expand Down
18 changes: 11 additions & 7 deletions test/distributed/cases/fulltext/fulltext.result
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ body VARCHAR(65535) YES MUL null
title TEXT(0) YES null
show create table src;
Table Create Table
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `body` varchar(65535) DEFAULT NULL,\n `title` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT(`body`,`title`),\n FULLTEXT(`body`)\n)
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `body` varchar(65535) DEFAULT NULL,\n `title` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT `ftidx`(`body`,`title`),\n FULLTEXT `ftidx2`(`body`)\n)
drop table src;
create table src2 (id1 varchar, id2 bigint, body char(128), title text, primary key (id1, id2));
insert into src2 values ('id0', 0, 'red', 't1'), ('id1', 1, 'yellow', 't2'), ('id2', 2, 'blue', 't3'), ('id3', 3, 'blue red', 't4');
Expand Down Expand Up @@ -254,7 +254,7 @@ json1 JSON(0) YES MUL null
json2 JSON(0) YES null
show create table src;
Table Create Table
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` json DEFAULT NULL,\n `json2` json DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT(`json1`) WITH PARSER json,\n FULLTEXT(`json1`,`json2`) WITH PARSER json\n)
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` json DEFAULT NULL,\n `json2` json DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT `ftidx`(`json1`) WITH PARSER json,\n FULLTEXT `ftidx2`(`json1`,`json2`) WITH PARSER json\n)
drop table src;
create table src (id bigint primary key, json1 text, json2 varchar);
insert into src values (0, '{"a":1, "b":"red"}', '{"d": "happy birthday", "f":"winter"}'),
Expand Down Expand Up @@ -282,7 +282,7 @@ json1 TEXT(0) YES MUL null
json2 VARCHAR(65535) YES null
show create table src;
Table Create Table
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` text DEFAULT NULL,\n `json2` varchar(65535) DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT(`json1`) WITH PARSER json,\n FULLTEXT(`json1`,`json2`) WITH PARSER json\n)
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` text DEFAULT NULL,\n `json2` varchar(65535) DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT `ftidx`(`json1`) WITH PARSER json,\n FULLTEXT `ftidx2`(`json1`,`json2`) WITH PARSER json\n)
drop table src;
create table src (id bigint primary key, body varchar, title text, FULLTEXT(title, body));
insert into src values (0, 'color is red', 't1'), (1, 'car is yellow', 'crazy car'), (2, 'sky is blue', 'no limit'), (3, 'blue is not red', 'colorful'),
Expand All @@ -296,6 +296,10 @@ insert into src values (0, 'color is red', 't1'), (1, 'car is yellow', 'crazy ca
(10, NULL, NULL);
select *, match(body) against('遠東兒童中文' in natural language mode) as score from src;
not supported: MATCH() AGAINST() function cannot be replaced by FULLTEXT INDEX and full table scan with fulltext search is not supported yet.
select *, match(title, body) against('+Windows +(<"Photo" >defender)' in boolean mode) as score from src;
internal error: double operator
select *, match(title, body) against('+CC_BY +(<-1.0 >-SA-1.0)' in boolean mode) as score from src;
internal error: double operator
select * from src where match(body, title) against('red');
id body title
0 color is red t1
Expand Down Expand Up @@ -390,7 +394,7 @@ body VARCHAR(65535) YES null
title TEXT(0) YES MUL null
show create table src;
Table Create Table
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `body` varchar(65535) DEFAULT NULL,\n `title` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT(`title`,`body`)\n)
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `body` varchar(65535) DEFAULT NULL,\n `title` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT (`title`,`body`)\n)
drop table src;
create table src2 (id1 varchar, id2 bigint, body char(128), title text, primary key (id1, id2), FULLTEXT(body, title));
insert into src2 values ('id0', 0, 'red', 't1'), ('id1', 1, 'yellow', 't2'), ('id2', 2, 'blue', 't3'), ('id3', 3, 'blue red', 't4');
Expand All @@ -410,7 +414,7 @@ body CHAR(128) YES MUL null
title TEXT(0) YES null
show create table src2;
Table Create Table
src2 CREATE TABLE `src2` (\n `id1` varchar(65535) NOT NULL,\n `id2` bigint NOT NULL,\n `body` char(128) DEFAULT NULL,\n `title` text DEFAULT NULL,\n PRIMARY KEY (`id1`,`id2`),\n FULLTEXT(`body`,`title`)\n)
src2 CREATE TABLE `src2` (\n `id1` varchar(65535) NOT NULL,\n `id2` bigint NOT NULL,\n `body` char(128) DEFAULT NULL,\n `title` text DEFAULT NULL,\n PRIMARY KEY (`id1`,`id2`),\n FULLTEXT (`body`,`title`)\n)
drop table src2;
create table src (id bigint primary key, json1 json, json2 json, FULLTEXT(json1) with parser json);
insert into src values (0, '{"a":1, "b":"red"}', '{"d": "happy birthday", "f":"winter"}'),
Expand Down Expand Up @@ -438,7 +442,7 @@ json1 JSON(0) YES MUL null
json2 JSON(0) YES null
show create table src;
Table Create Table
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` json DEFAULT NULL,\n `json2` json DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT(`json1`) WITH PARSER json,\n FULLTEXT(`json1`,`json2`) WITH PARSER json\n)
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` json DEFAULT NULL,\n `json2` json DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT (`json1`) WITH PARSER json,\n FULLTEXT `ftidx2`(`json1`,`json2`) WITH PARSER json\n)
drop table src;
create table src (id bigint primary key, json1 text, json2 varchar, fulltext(json1) with parser json);
insert into src values (0, '{"a":1, "b":"red"}', '{"d": "happy birthday", "f":"winter"}'),
Expand Down Expand Up @@ -469,7 +473,7 @@ json1 TEXT(0) YES MUL null
json2 VARCHAR(65535) YES null
show create table src;
Table Create Table
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` text DEFAULT NULL,\n `json2` varchar(65535) DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT(`json1`) WITH PARSER json,\n FULLTEXT(`json1`,`json2`) WITH PARSER json\n)
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` text DEFAULT NULL,\n `json2` varchar(65535) DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT (`json1`) WITH PARSER json,\n FULLTEXT `ftidx2`(`json1`,`json2`) WITH PARSER json\n)
drop table src;
drop table if exists t1;
create table t1(a int primary key, b varchar(200));
Expand Down
2 changes: 2 additions & 0 deletions test/distributed/cases/fulltext/fulltext.sql
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ insert into src values (0, 'color is red', 't1'), (1, 'car is yellow', 'crazy ca

-- check error
select *, match(body) against('遠東兒童中文' in natural language mode) as score from src;
select *, match(title, body) against('+Windows +(<"Photo" >defender)' in boolean mode) as score from src;
select *, match(title, body) against('+CC_BY +(<-1.0 >-SA-1.0)' in boolean mode) as score from src;

-- match in WHERE clause
select * from src where match(body, title) against('red');
Expand Down
4 changes: 2 additions & 2 deletions test/distributed/cases/fulltext/fulltext1.result
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use test;
create table articles (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT, FULLTEXT (title,body));
show create table articles;
Table Create Table
articles CREATE TABLE `articles` (\n `id` int unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(200) DEFAULT NULL,\n `body` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT(`title`,`body`)\n)
articles CREATE TABLE `articles` (\n `id` int unsigned NOT NULL AUTO_INCREMENT,\n `title` varchar(200) DEFAULT NULL,\n `body` text DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT (`title`,`body`)\n)
drop table articles;
create table articles (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT);
create fulltext index fdx_01 on articles(title, body);
Expand All @@ -23,7 +23,7 @@ create table src (id bigint primary key, json1 json, json2 json);
create fulltext index ftidx1 on src(json1) with parser json;
show create table src;
Table Create Table
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` json DEFAULT NULL,\n `json2` json DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT(`json1`) WITH PARSER json\n)
src CREATE TABLE `src` (\n `id` bigint NOT NULL,\n `json1` json DEFAULT NULL,\n `json2` json DEFAULT NULL,\n PRIMARY KEY (`id`),\n FULLTEXT `ftidx1`(`json1`) WITH PARSER json\n)
alter table src drop column json1;
drop table src;
create table articles (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, title VARCHAR(200), body TEXT);
Expand Down
Loading

0 comments on commit 8476083

Please sign in to comment.