Skip to content

Commit a6526b5

Browse files
authored
Fix fulltext matching
If the index name on a fulltext key contains the string `key`, then the `.+` pattern greedily matches too far into the string and produces an invalid line. This fix will correctly replace ` FULLTEXT KEY` with ` KEY` regardless of the contents of the index name.
1 parent 3cedfa6 commit a6526b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mysql2sqlite

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ inView != 0 { next }
157157
}
158158

159159
# Replace `FULLTEXT KEY` (probably other `XXXXX KEY`)
160-
/^ (FULLTEXT KEY|fulltext key)/ { gsub( /.+(KEY|key)/, " KEY" ) }
160+
/^ (FULLTEXT KEY|fulltext key)/ { gsub( /[A-Za-z ]+(KEY|key)/, " KEY" ) }
161161

162162
# Get rid of field lengths in KEY lines
163163
/ (PRIMARY |primary )?(KEY|key)/ { gsub( /\([0-9]+\)/, "" ) }

0 commit comments

Comments
 (0)