Skip to content

Implement test on concurrency insert/update in cluster environment #3194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 27 commits into
base: master
Choose a base branch
from

Conversation

donhardman
Copy link
Contributor

No description provided.

Copy link

clt

❌ CLT tests in test/clt-tests/bugs/
✅ OK: 0
❌ Failed: 1
⏳ Duration: 10s
👉 Check Action Results for commit 4d88e61
Failed tests:

test/clt-tests/bugs/3048-write-concurrency-in-cluster.rec
––– input –––
export INSTANCE=1
––– output –––
––– input –––
export INSTANCE=2
––– output –––
––– input –––
export CLUSTER_NAME=c
––– output –––
––– input –––
mysql -h0 -P1306 -e "create table system.test (id bigint, name string, value json)"
––– output –––
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
––– input –––
mysql -h0 -P1306 -e "alter cluster c add system.test"
––– output –––
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
––– input –––
for i in {1..20}; do
mysql -h0 -P1306 -e "update c:system.test set value = '{\"a\":2}' where name = 'node'" &
mysql -h0 -P2306 -e "insert into c:system.test values (0, 'slave', '{\"a\":1}')" &
done
––– output –––
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
––– input –––
timeout 10 sh -c "wait && echo 'All good'" || echo "There is issue with hang up of parallel request in different nodes"
––– output –––
- All good
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERRORAll good

Copy link

clt

❌ CLT tests in test/clt-tests/bugs/
✅ OK: 1
❌ Failed: 1
⏳ Duration: 26s
👉 Check Action Results for commit fc8998b
Failed tests:

test/clt-tests/bugs/3048-write-concurrency-in-cluster.rec
––– input –––
export INSTANCE=1
––– output –––
––– input –––
export INSTANCE=2
––– output –––
––– input –––
export CLUSTER_NAME=c
––– output –––
––– input –––
mysql -h0 -P1306 -e "create table system.test (id bigint, name string, value json)"
––– output –––
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
––– input –––
mysql -h0 -P1306 -e "alter cluster c add system.test"
––– output –––
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
––– input –––
for i in {1..20}; do
mysql -h0 -P1306 -e "update c:system.test set value = '{\"a\":2}' where name = 'node'" &
mysql -h0 -P2306 -e "insert into c:system.test values (0, 'slave', '{\"a\":1}')" &
done
––– output –––
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
––– input –––
timeout 10 sh -c "wait && echo 'All good'" || echo "There is issue with hang up of parallel request in different nodes"
––– output –––
- All good
+ ySQL server on '0:1306' (111)
+ 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERRORERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERRORERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:2306' (111)
+ ERROR 2003 (HY000): Can't connect to MySQL server on '0:1306' (111)
+ All good

Copy link

clt

❌ CLT tests in test/clt-tests/buddy/
✅ OK: 7
❌ Failed: 1
⏳ Duration: 106s
👉 Check Action Results for commit ce85f79
Failed tests:

test/clt-tests/buddy/test-fuzzy-search.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd; if timeout 10 grep -qm1 '\[BUDDY\] started' <(tail -n 1000 -f /var/log/manticore/searchd.log); then echo 'Buddy started!'; else echo 'Timeout or failed!'; cat /var/log/manticore/searchd.log;fi
––– output –––
Manticore %{VERSION} (columnar %{VERSION}) (secondary %{VERSION}) (knn %{VERSION})
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-%{YEAR}, Manticore Software LTD (https://manticoresearch.com)
[#!/[0-9a-zA-Z\:\.\s]+/!#] [%{NUMBER}] using config file '%{PATH}' (%{NUMBER} chars)...
starting daemon version '%{VERSION} (columnar %{VERSION}) (secondary %{VERSION}) (knn %{VERSION})' ...
listening on %{IPADDR}:9312 for sphinx and http(s)
listening on %{IPADDR}:9306 for mysql
listening on %{IPADDR}:9308 for sphinx and http(s)
Buddy started!
––– input –––
apt-get update -y > /dev/null; echo $?
––– output –––
0
––– input –––
apt-get install jq -y > /dev/null; echo $?
––– output –––
debconf: delaying package configuration, since apt-utils is not installed
0
––– input –––
php -d memory_limit=2G ./test/clt-tests/scripts/load_names_attr.php --batch-size=100000 --concurrency=4 --docs=1000000 --start-id=1 --min-infix-len=2 > /dev/null; echo $?
––– output –––
0
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE name;" | grep "min_infix_len='2'" | sed "s/.*\(min_infix_len='2'\).*/\1/"
––– output –––
min_infix_len='2'
––– input –––
mysql -h0 -P9306 -e "SELECT COUNT(*) FROM name;"
––– output –––
+----------+
| count(*) |
+----------+
|  1000000 |
+----------+
––– input –––
mysql -h0 -P9306 -e "OPTIMIZE TABLE name OPTION sync=1;"
––– output –––
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('RICH') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+------+-------------------+------+
| id   | username          | s    |
+------+-------------------+------+
|  196 | BRICE MULLIN      | a    |
|  307 | GRICELDA SKELTON  | a    |
|  363 | LAURICE SOLIZ     | a    |
|  478 | ERICH LLAMAS      | a    |
|  490 | LATRICE MANCILLA  | a    |
|  608 | MAURICE PRATHER   | a    |
|  659 | BRICE OLIVARES    | a    |
|  697 | PATRICE WOOD      | a    |
|  822 | JUNITA RICHARD    | a    |
|  835 | AUREA RICO        | a    |
|  854 | ROXANNE BRICE     | a    |
| 1122 | RICH MOLL         | a    |
| 1134 | JOELLA RICHARD    | a    |
| 1160 | MINDY HEINRICH    | a    |
| 1224 | YADIRA RICHARDSON | a    |
| 1379 | BRICE ALLMAN      | a    |
| 1574 | RICO VALENZUELA   | a    |
| 1602 | BEATRICE LOVE     | a    |
| 1822 | RICHELLE ROE      | a    |
| 2136 | CHIQUITA RICHTER  | a    |
+------+-------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('EBGRNA') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+------+----------------------+------+
| id   | username             | s    |
+------+----------------------+------+
|  675 | CONCEPTION ABERNATHY | a    |
|  964 | BERNARDINA OSHEA     | a    |
| 1354 | VERNA VITALE         | a    |
| 1784 | BERNADETTE HALES     | a    |
| 1839 | BERNARDINA MCMILLAN  | a    |
| 1864 | ERNA ULLOA           | a    |
| 1948 | SAMIRA ABERNATHY     | a    |
| 2238 | JUDI BERNAL          | a    |
| 2446 | MERNA GAITHER        | a    |
| 3065 | BERNADINE HIBBARD    | a    |
| 3195 | BERNADETTE SHELTON   | a    |
| 3688 | VERNA GASTON         | a    |
| 3781 | BERNARDINE WILKINS   | a    |
| 4370 | ERNA VITALE          | a    |
| 4637 | TARSHA HERNANDEZ     | a    |
| 4662 | FERNANDO HOUCK       | a    |
| 5044 | CONSTANCE ABERNATHY  | a    |
| 5580 | LAVERNA GORMAN       | a    |
| 5582 | FERNANDE ISRAEL      | a    |
| 5798 | LAVERNA STORM        | a    |
+------+----------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('ANT') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+------+-------------------+------+
| id   | username          | s    |
+------+-------------------+------+
|    8 | DAMIAN SOMERS     | a    |
|   16 | TAMI WHELAN       | a    |
|   19 | DARCY SANDBERG    | a    |
|   20 | RANEE BROUGHTON   | a    |
|   21 | STEPHEN ALLMAN    | a    |
|   30 | AMANDA KEY        | a    |
|   37 | ELFRIEDA HANKS    | a    |
|   41 | NANNIE WILLINGHAM | a    |
|   42 | YOULANDA TROUT    | a    |
|   44 | ANTHONY SMOOT     | a    |
|   47 | FRANCIE BUNDY     | a    |
|   51 | LATASHA POLAND    | a    |
|   53 | SHEMEKA DURAND    | a    |
|   54 | LATANYA ARNDT     | a    |
|   56 | JANELLE LASTER    | a    |
|   57 | NANNIE HANNON     | a    |
|   58 | GRANVILLE VALDEZ  | a    |
|   59 | DEDE SPANN        | a    |
|   60 | DANIEL MERRITT    | a    |
|   63 | SAUL HOWLAND      | a    |
+------+-------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('tony') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+------+--------------------+------+
| id   | username           | s    |
+------+--------------------+------+
|  118 | ANTONIA VANWINKLE  | a    |
|  220 | ANTONIA MELGAR     | a    |
|  391 | KARYL TONEY        | a    |
|  761 | TONYA SHERRILL     | a    |
| 1527 | LEONE TONEY        | a    |
| 2132 | TONIA RAPP         | a    |
| 2195 | TONIE HOANG        | a    |
| 2333 | LATONIA VILLASENOR | a    |
| 2357 | TONIE BARNHILL     | a    |
| 2430 | TONIA BOSTICK      | a    |
| 2584 | TONI SPENCE        | a    |
| 2725 | ANTONIETTA CINTRON | a    |
| 2881 | ANTONINA HASKELL   | a    |
| 3318 | TONY DUPRE         | a    |
| 3582 | ANTONIETTA BAEZ    | a    |
| 3858 | TONEY SCHOEN       | a    |
| 4366 | ROCHEL TONEY       | a    |
| 4608 | ANTONIA DRISCOLL   | a    |
| 4657 | TONYA PARRIS       | a    |
| 4800 | TONY WEISS         | a    |
+------+--------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMITH') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
~ +--------+-------------------+------+
~ | id     | username          | s    |
~ +--------+-------------------+------+
~ | 999973 | KEITH SNOW        | a    |
~ | 999855 | DOROTHA WISEMAN250 | MINH LANDERS    | a    |
~ | 999723 | SCOTT OLSON   7815 | MINH GOODWIN    | a    |
~ | 999264 | RUTHANN GREENE6259 | MINH WILD       | a    |
~ | 999250 | MINH LANDERS     6078 | CHRISTENE KEITH | a    |
~ | 999127 | MALENA RUTHERFORD5989 | KEITH PARNELL   | a    |
~ | 999120 | RUTHANNE CARDOS5593 | KEITHA MURILLO  | a    |
~ | 998893 | IRWIN SOUTHARD   3855 | MINH POINDEXTER | a    |
~ | 998691 | MITCHELL SEITZ3408 | KEITH OKEEFE    | a    |
~ | 998539 | ELSA SEITZ   3273 | CAREY KEITH     | a    |
~ | 998526 | SCOTT CARRION   2679 | KEITHA KILLIAN  | a    |
~ | 997945 | RUTHE SCHENK2597 | MARA KEITH      | a    |
~ | 997815 | MINH GOODWIN     2056 | KEITH SYLVESTER | a    |
~ | 997558 | ARTIE SOUTH 1206 | MINH FAHEY      | a    |
~ | 997189 | BETTY SOUTHERN  0556 | KEITHA MARTINI  | a    |
~ | 997187 | SUSAN SCOTT     89718 | KEITH FLAHERTY  | a    |
~ | 997098 | OTHA FAJARDO  87159 | MINH PARNELL    | a    |
~ | 997074 | SCOTT FLANDERS86143 | KEITHA YUAN     | a    |
~ | 996804 | SCOTT ENOS    85925 | VENITA SMYTH    | a    |
~ | 996461 | EDRA HIGGINBOTHAM84631 | KEITH LERNER    | a    |
~ +--------+-------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMITH') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
~ +--------+-------------------+------+
~ | id     | username          | s    |
~ +--------+-------------------+------+
~ | 999973 | KEITH SNOW        | a    |
~ | 999855 | DOROTHA WISEMAN250 | MINH LANDERS    | a    |
~ | 999723 | SCOTT OLSON   7815 | MINH GOODWIN    | a    |
~ | 999264 | RUTHANN GREENE6259 | MINH WILD       | a    |
~ | 999250 | MINH LANDERS     6078 | CHRISTENE KEITH | a    |
~ | 999127 | MALENA RUTHERFORD5989 | KEITH PARNELL   | a    |
~ | 999120 | RUTHANNE CARDOS5593 | KEITHA MURILLO  | a    |
~ | 998893 | IRWIN SOUTHARD   3855 | MINH POINDEXTER | a    |
~ | 998691 | MITCHELL SEITZ3408 | KEITH OKEEFE    | a    |
~ | 998539 | ELSA SEITZ   3273 | CAREY KEITH     | a    |
~ | 998526 | SCOTT CARRION   2679 | KEITHA KILLIAN  | a    |
~ | 997945 | RUTHE SCHENK2597 | MARA KEITH      | a    |
~ | 997815 | MINH GOODWIN     2056 | KEITH SYLVESTER | a    |
~ | 997558 | ARTIE SOUTH 1206 | MINH FAHEY      | a    |
~ | 997189 | BETTY SOUTHERN  0556 | KEITHA MARTINI  | a    |
~ | 997187 | SUSAN SCOTT     89718 | KEITH FLAHERTY  | a    |
~ | 997098 | OTHA FAJARDO  87159 | MINH PARNELL    | a    |
~ | 997074 | SCOTT FLANDERS86143 | KEITHA YUAN     | a    |
~ | 996804 | SCOTT ENOS    85925 | VENITA SMYTH    | a    |
~ | 996461 | EDRA HIGGINBOTHAM84631 | KEITH LERNER    | a    |
~ +--------+-------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMYTH') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
~ +--------+---------------------+------+
~ | id     | username            | s    |
~ +--------+---------------------+------+
~ | 999973 | KEITH SNOW  8893 | IRWIN SOUTHARD      | a    |
~ | 999964 | CANDACE BOOTH8000 | EDYTH CARLISLE      | a    |
~ | 999855 | DOROTHA WISEMAN7558 | ARTIE SOUTH         | a    |
~ | 999723 | SCOTT OLSON 7189 | BETTY SOUTHERN      | a    |
~ | 999264 | RUTHANN GREENE   5514 | LAVELLE SOUTHERLAND | a    |
~ | 999197 | HEATH MCNAMARA5220 | EDYTHE DEGUZMAN     | a    |
~ | 999127 | MALENA RUTHERFORD5208 | MARLON SOUTHERN     | a    |
~ | 999120 | RUTHANNE CARDOSO4472 | EDYTHE PYLE         | a    |
~ | 999013 | HEATHER HAMMOCK3920 | YANG SOUTH          | a    |
~ | 998893 | IRWIN SOUTHARD3906 | SETH BATTLES        | a    |
~ | 998526 | SCOTT CARRION3838 | EDYTHE ZENG         | a    |
~ | 998000 | EDYTH CARLISLE3509 | SETH GRIFFITH       | a    |
~ | 997945 | RUTHE SCHENK3488 | EDYTH BATTEN        | a    |
~ | 997558 | ARTIE SOUTH3140 | LYN SOUTHERN        | a    |
~ | 997544 | HEATHER CLAUSEN2255 | TRENTON SOUTHERN    | a    |
~ | 997189 | BETTY SOUTHERN2085 | ASHLYN SOUTH        | a    |
~ | 997187 | SUSAN SCOTT    1919 | LELAH SOUTHERLAND   | a    |
~ | 997098 | OTHA FAJARDO89609 | EDYTH NOVAK         | a    |
~ | 997074 | SCOTT FLANDERS87549 | EMILIA SOUTH        | a    |
~ | 996804 | SCOTT ENOS87177 | SETH KOZAK          | a    |
~ +--------+---------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMITH') ORDER BY id DESC, username ASC OPTION fuzzy="1";"
––– output –––
~ +--------+-------------------+------+
~ | id     | username          | s    |
~ +--------+-------------------+------+
~ | 999973 | KEITH SNOW        | a    |
~ | 999855 | DOROTHA WISEMAN250 | MINH LANDERS    | a    |
~ | 999723 | SCOTT OLSON   7815 | MINH GOODWIN    | a    |
~ | 999264 | RUTHANN GREENE6259 | MINH WILD       | a    |
~ | 999250 | MINH LANDERS     6078 | CHRISTENE KEITH | a    |
~ | 999127 | MALENA RUTHERFORD5989 | KEITH PARNELL   | a    |
~ | 999120 | RUTHANNE CARDOS5593 | KEITHA MURILLO  | a    |
~ | 998893 | IRWIN SOUTHARD   3855 | MINH POINDEXTER | a    |
~ | 998691 | MITCHELL SEITZ3408 | KEITH OKEEFE    | a    |
~ | 998539 | ELSA SEITZ   3273 | CAREY KEITH     | a    |
~ | 998526 | SCOTT CARRION   2679 | KEITHA KILLIAN  | a    |
~ | 997945 | RUTHE SCHENK2597 | MARA KEITH      | a    |
~ | 997815 | MINH GOODWIN     2056 | KEITH SYLVESTER | a    |
~ | 997558 | ARTIE SOUTH 1206 | MINH FAHEY      | a    |
~ | 997189 | BETTY SOUTHERN  0556 | KEITHA MARTINI  | a    |
~ | 997187 | SUSAN SCOTT     89718 | KEITH FLAHERTY  | a    |
~ | 997098 | OTHA FAJARDO  87159 | MINH PARNELL    | a    |
~ | 997074 | SCOTT FLANDERS86143 | KEITHA YUAN     | a    |
~ | 996804 | SCOTT ENOS    85925 | VENITA SMYTH    | a    |
~ | 996461 | EDRA HIGGINBOTHAM84631 | KEITH LERNER    | a    |
~ +--------+-------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('john') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
+--------+------------------------+------+
| id     | username               | s    |
+--------+------------------------+------+
| 999961 | JONELL ENRIGHT         | a    |
| 999932 | JONELL NIX             | a    |
| 999926 | JONAH BURNSIDE         | a    |
| 999922 | LAVONNA JONAS          | a    |
| 999860 | JOHNETTA DO            | a    |
| 999552 | JOHNNY CARNES          | a    |
| 999548 | JOHNATHAN PEPPER       | a    |
| 999509 | JOHNATHAN STUBBLEFIELD | a    |
| 999171 | JOHNNY ABRAMS          | a    |
| 999033 | AGNUS STJOHN           | a    |
| 998835 | SCARLETT JONAS         | a    |
| 998798 | JOHNATHON READ         | a    |
| 998467 | JOHNSON JEAN           | a    |
| 998393 | JOHN BACH              | a    |
| 998306 | JOHNNY TAFOYA          | a    |
| 998304 | JONG SAUER             | a    |
| 998303 | JONATHON DUPRE         | a    |
| 998278 | JOHNNIE LOR            | a    |
| 998181 | JONA ELROD             | a    |
| 998154 | JONG YORK              | a    |
+--------+------------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('jane') AND id BETWEEN 10000 AND 20000 ORDER BY username ASC OPTION fuzzy=1;"
––– output –––
+-------+--------------------+------+
| id    | username           | s    |
+-------+--------------------+------+
| 10028 | ANJANETTE PORTILLO | a    |
| 10056 | JANETTE LYNCH      | a    |
| 10629 | LANETTE SWAIN      | a    |
| 10874 | JANESSA MONTEZ     | a    |
| 10977 | RUTHANN LANEY      | a    |
| 11038 | DESIRE LANE        | a    |
| 11056 | LANELLE WATTS      | a    |
| 11397 | MELITA LANE        | a    |
| 11415 | MARYJANE HOLTZ     | a    |
| 11569 | JANETH SELBY       | a    |
| 11758 | JANETTE GANTT      | a    |
| 11834 | JANELLE DRIGGERS   | a    |
| 12100 | JAE COBLE          | a    |
| 12171 | JAE MEARS          | a    |
| 12185 | JANESSA BALTAZAR   | a    |
| 12237 | JANENE APODACA     | a    |
| 12490 | LANELLE ARNDT      | a    |
| 12536 | JANENE WALDRON     | a    |
| 12540 | ANJANETTE STAGGS   | a    |
| 12642 | HERSHEL LANEY      | a    |
+-------+--------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('EBGRNA') AND id BETWEEN 1000 AND 2000 ORDER BY username ASC OPTION fuzzy=1;"
––– output –––
+------+---------------------+------+
| id   | username            | s    |
+------+---------------------+------+
| 1354 | VERNA VITALE        | a    |
| 1784 | BERNADETTE HALES    | a    |
| 1839 | BERNARDINA MCMILLAN | a    |
| 1864 | ERNA ULLOA          | a    |
| 1948 | SAMIRA ABERNATHY    | a    |
+------+---------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SARA') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+------+------------------+------+
| id   | username         | s    |
+------+------------------+------+
|  188 | LARA KIRK        | a    |
|  207 | CLARA MORRIS     | a    |
|  351 | KLARA DONALDSON  | a    |
|  990 | ELAINE SARABIA   | a    |
| 1409 | LARA FREDERICK   | a    |
| 1661 | SARA GARNER      | a    |
| 1831 | SARAI ESPINAL    | a    |
| 2074 | VALENTIN SARABIA | a    |
| 2930 | LARA CINTRON     | a    |
| 3045 | KLARA ANDRES     | a    |
| 3373 | KLARA NORTON     | a    |
| 3741 | CRUZ SARABIA     | a    |
| 3780 | RUSSEL LARA      | a    |
| 4700 | HEE SARABIA      | a    |
| 4933 | KLARA GOODING    | a    |
| 5830 | SARAI LINDLEY    | a    |
| 5865 | SARAN KNAPP      | a    |
| 5918 | SARA WAITE       | a    |
| 6635 | CLARA BEALE      | a    |
| 6836 | CLARA BAZAN      | a    |
+------+------------------+------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS fuzziness);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 'us,ru' AS layouts);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS append);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 0 AS prepend);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnson |
| jonas   |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS prepend, 1 AS append);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS fuzziness, '' AS layouts, 1 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 2 AS fuzziness, 'us,ru' AS layouts, 1 AS append, 1 AS prepend, 2 AS expansion_len);" | tail -n +4 | sort
––– output –––
+-------+
| joe   |
| john  |
| jose  |
| joy   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS append);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS prepend);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 'us' AS layouts);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 'ru' AS layouts);" | tail -n +4 | sort
––– output –––
+---------+
| joe     |
| john    |
| johnie  |
| johnson |
| jordan  |
| jose    |
| joseph  |
| joshua  |
| joy     |
| joyce   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('al', 'name', 0 AS fuzziness);" | tail -n +4 | sort
––– output –––
+-----------+
| albert    |
| alexander |
| allen     |
| dale      |
| dallas    |
| donald    |
| gale      |
| kendall   |
| marshall  |
| walter    |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('mi', 'name', 0 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
+---------+
| ami     |
| britni  |
| brittni |
| cami    |
| choi    |
| darci   |
| eleni   |
| jami    |
| jani    |
| jeni    |
| joi     |
| kaci    |
| kami    |
| kimi    |
| laci    |
| lani    |
| luci    |
| mancini |
| marci   |
| martini |
| melani  |
| muoi    |
| nanci   |
| neomi   |
| noemi   |
| nohemi  |
| ricci   |
| shani   |
| staci   |
| tammi   |
| toi     |
| tomi    |
| traci   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('ch', 'name', 1 AS fuzziness, 3 AS expansion_len);" | tail -n +4 | sort
––– output –––
+-------+
| chang |
| chi   |
| chong |
| chung |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('зф', 'name', 'us,ru' AS layouts);" | tail -n +4 | sort
––– output –––
+---------+
| page    |
| paige   |
| palma   |
| palmer  |
| paris   |
| parker  |
| pat     |
| patrick |
| paul    |
| paz     |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('зф', 'name', 'us' AS layouts);" | tail -n +4 | sort
––– output –––
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('gr', 'name', 1 AS fuzziness, 'ru' AS layouts, 1 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
+------------+
| grace      |
| gracia     |
| grady      |
| graham     |
| grant      |
| gregg      |
| gregory    |
| griffin    |
| grover     |
| montenegro |
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); select * from t where match('somethin') option fuzzy=0;"
––– output –––
––– input –––
mysql -h0 -P9306 -e "select * from t where match('somethin') option fuzzy=0;"
––– output –––
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
+-----------+
| query     |
+-----------+
| some      |
| something |
+-----------+
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
+-----------+
| query     |
+-----------+
| some      |
| something |
+-----------+
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(a int);"
––– output –––
––– input –––
mysql -h0 -P9306 -e "select * from t option fuzzy=1;"
––– output –––
ERROR 1064 (42000) at line 1: The 'fuzzy' option requires a full-text query
––– input –––
mysql -h0 -P9306 -e "drop table if exists comment_28798446; create table comment_28798446(id int, content text) min_infix_len='3';"
––– output –––
––– input –––
mysql -h0 -P9306 -e "insert into comment_28798446 values (1, 'business Manticore interaction'), (2, 'buisness Manticore interation'), (3, 'other text content');"
––– output –––
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('buisness Manticore interation') OPTION fuzzy = 1, layouts = '';"
––– output –––
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('business Manticore interaction') OPTION fuzzy = 1, layouts = '';"
––– output –––
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('Manticore') OPTION fuzzy = 1, layouts = '';"
––– output –––
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', 'ru,us,ua' AS layouts);"
––– output –––
+----------+
| query    |
+----------+
| business |
+----------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', '' AS layouts);"
––– output –––
+----------+
| query    |
+----------+
| business |
+----------+
––– input –––
mysql -h0 -P9306 -e "DROP TABLE IF EXISTS t; DEBUG SLEEP 2; CREATE TABLE t(f TEXT) min_infix_len='2';"
––– output –––
+---------+--------+
| command | result |
+---------+--------+
| sleep   | #!/[0-9]{1}.[0-9]{3}/!#  |
+---------+--------+
––– input –––
mysql -h0 -P9306 -e "INSERT INTO t VALUES (1, 'abcdef'), (2, 'abcd efgh');"
––– output –––
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('abcdef'); SHOW META;"
––– output –––
+------+--------+
| id   | f      |
+------+--------+
|    1 | abcdef |
+------+--------+
+----------------+--------+
| Variable_name  | Value  |
+----------------+--------+
| total          | 1      |
| total_found    | 1      |
| total_relation | eq     |
| time           | #!/[0-9]{1}.[0-9]{3}/!#  |
| keyword[0]     | abcdef |
| docs[0]        | 1      |
| hits[0]        | 1      |
+----------------+--------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('abcef') OPTION fuzzy=1; SHOW META;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    1 | abcdef    |
|    2 | abcd efgh |
+------+-----------+
+----------------+-------+
| Variable_name  | Value |
+----------------+-------+
| total          | 2     |
| total_found    | 2     |
| total_relation | eq    |
| time           | #!/[0-9]{1}.[0-9]{3}/!# |
+----------------+-------+
––– input –––
grep -A3 "SELECT \* FROM t WHERE MATCH('abcdef')" /var/log/manticore/query.log
––– output –––
/* #!/[A-Za-z]{3}\s+[A-Za-z]{3}\s+[0-9]{1,2}\s+[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\s+[0-9]{4}/!# conn %{NUMBER} (127.0.0.1:%{NUMBER}) real #!/[0-9]{1}.[0-9]{3}/!# wall #!/[0-9]{1}.[0-9]{3}/!# found 1 */ SELECT * FROM t WHERE MATCH('abcdef');
/* #!/[A-Za-z]{3}\s+[A-Za-z]{3}\s+[0-9]{1,2}\s+[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\s+[0-9]{4}/!# conn %{NUMBER} (127.0.0.1:%{NUMBER}) real #!/[0-9]{1}.[0-9]{3}/!# wall #!/[0-9]{1}.[0-9]{3}/!# found 2 */ SELECT * FROM t WHERE MATCH('abcef') OPTION fuzzy=1;
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('nonexistent'); SHOW META;"
––– output –––
+----------------+-------------+
| Variable_name  | Value       |
+----------------+-------------+
| total          | 0           |
| total_found    | 0           |
| total_relation | eq          |
| time           | #!/[0-9]{1}.[0-9]{3}/!#       |
| keyword[0]     | nonexistent |
| docs[0]        | 0           |
| hits[0]        | 0           |
+----------------+-------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('abcdef') OPTION fuzzy=1;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    1 | abcdef    |
|    2 | abcd efgh |
+------+-----------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('\$#@\!') OPTION fuzzy=1;"
––– output –––
––– input –––
mysql -h0 -P9306 -e "DROP TABLE IF EXISTS idx1; CREATE TABLE idx1(value TEXT) min_infix_len='2';"
––– output –––
––– input –––
mysql -h0 -P9306 -e "INSERT INTO idx1(value) VALUES ('340');"
––– output –––
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('34', 'idx1');"
––– output –––
+-------+
| query |
+-------+
| 340   |
+-------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('3', 'idx1');"
––– output –––
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('34', 'idx1', 1 AS fuzziness);"
––– output –––
+-------+
| query |
+-------+
| 340   |
+-------+
––– input –––
echo -e "searchd {\nlisten = 9306:mysql\nlisten = 9312\nlisten = 9308:http\nlog = /tmp/searchd.log\nquery_log = /tmp/query.log\npid_file = /tmp/searchd.pid\n}\n\nsource src_idx {\ntype = tsvpipe\ntsvpipe_command = cat /tmp/data.tsv\ntsvpipe_field_string = f\ntsvpipe_attr_bigint = id\n}\n\nindex idx_plain {\ntype = plain\nsource = src_idx\npath = /tmp/idx_plain\nmin_infix_len = 2\n}" > /tmp/manticore_idx.conf
––– output –––
––– input –––
echo -e "1\tabcdef\n2\tabcd efgh\n3\trandom text" > /tmp/data.tsv
––– output –––
––– input –––
mkdir -p /tmp/idx_plain && chmod 777 /tmp/idx_plain
––– output –––
––– input –––
indexer --all --config /tmp/manticore_idx.conf > /dev/null 2>&1
––– output –––
––– input –––
rm -f /tmp/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd -c /tmp/manticore_idx.conf; if timeout 10 grep -qm1 '\[BUDDY\] started' <(tail -n 1000 -f /var/log/manticore/searchd.log); then echo 'Buddy started!'; else echo 'Timeout or failed!'; cat /var/log/manticore/searchd.log;fi
––– output –––
Manticore %{VERSION} (columnar %{VERSION}) (secondary %{VERSION}) (knn %{VERSION})
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-%{YEAR}, Manticore Software LTD (https://manticoresearch.com)
[#!/[0-9a-zA-Z\:\.\s]+/!#] [#!/[0-9]+/!#] using config file '/tmp/manticore_idx.conf' (%{NUMBER} chars)...
starting daemon version '%{VERSION} (columnar %{VERSION}) (secondary %{VERSION}) (knn %{VERSION})' ...
listening on all interfaces for mysql, port=9306
listening on all interfaces for sphinx and http(s), port=9312
listening on all interfaces for sphinx and http(s), port=9308
precaching table 'idx_plain'
precached 1 tables in #!/[0-9]{1,2}.[0-9]+/!# sec
Buddy started!
––– input –––
mysql -h0 -P9306 -e "SHOW TABLES;"
––– output –––
+-----------+-------+
| Table     | Type  |
+-----------+-------+
| idx_plain | local |
+-----------+-------+
––– input –––
mysql -h0 -P9306 -e "SHOW TABLE idx_plain SETTINGS;"
––– output –––
+---------------+-------------------+
| Variable_name | Value             |
+---------------+-------------------+
| settings      | min_infix_len = 2 |
+---------------+-------------------+
––– input –––
mysql -h0 -P9306 -e "show version\G;"
––– output –––
*************************** 1. row ***************************
Component: Daemon
Version: %{VERSION}
*************************** 2. row ***************************
Component: Columnar
Version: columnar %{VERSION}
*************************** 3. row ***************************
Component: Secondary
Version: secondary %{VERSION}
*************************** 4. row ***************************
Component: KNN
Version: knn %{VERSION}
*************************** 5. row ***************************
Component: Buddy
Version: buddy %{VERSION}
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcdef') OPTION fuzzy=1;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    1 | abcdef    |
|    2 | abcd efgh |
+------+-----------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcef') OPTION fuzzy=1;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    1 | abcdef    |
|    2 | abcd efgh |
+------+-----------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('nonexistent') OPTION fuzzy=1;"
––– output –––
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('abc', 'idx_plain');"
––– output –––
+--------+
| query  |
+--------+
| abcd   |
| abcdef |
+--------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('ran', 'idx_plain');"
––– output –––
+--------+
| query  |
+--------+
| random |
+--------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('zzz', 'idx_plain');"
––– output –––
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcdef') OPTION fuzzy=0;"
––– output –––
+------+--------+
| id   | f      |
+------+--------+
|    1 | abcdef |
+------+--------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcd efgh') OPTION fuzzy=0;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    2 | abcd efgh |
+------+-----------+

klirichek and others added 16 commits March 13, 2025 13:11
Updated corresponding tests
---------

Co-authored-by: Pavel_Shilin <[email protected]>
Co-authored-by: Pavel Shilin <[email protected]>
Co-authored-by: githubmanticore <[email protected]>
Co-authored-by: Don Hardman <[email protected]>
Co-authored-by: githubmanticore <[email protected]>
Co-authored-by: Sergey Nikolaev <[email protected]>
* Improved and test replication-with-mysqldump.rec, adding new data and checks

* Added checking status nodes

* Splitting a common mysqldump into separate tables

* Added cases using different users

* Added cases using different flags and users to the test replication-with-mysqldump.rec

* Added checks that stopwords and exceptions are correctly restored and working in the cluster after dumping

---------

Co-authored-by: Pavel_Shilin <[email protected]>
* Updating all blocks in the daemon stop startup

* Update test-fuzzy-search.rec
Co-authored-by: githubmanticore <[email protected]>
Co-authored-by: Sergey Nikolaev <[email protected]>
…zed to its initial dimensions on ALTER; fixed an issue where the KNN index was not generated on ALTER
fixed an issue where a float vector with a KNN index was not initialized to its initial dimensions on ALTER; fixed an issue where the KNN index was not generated on ALTER
fixed an issue where the joined weight from the right table could not be used in the ORDER BY clause
New cases ranker or field_weights added to test-fuzzy-search.rec
* Bump buddy version to: 3.26.2+25031717-1bdadd15-dev

* Bump buddy version to: 3.26.3+25031718-2424762a-dev

---------

Co-authored-by: githubmanticore <[email protected]>
Copy link

clt

❌ CLT tests in test/clt-tests/bugs/
✅ OK: 1
❌ Failed: 1
⏳ Duration: 24s
👉 Check Action Results for commit 8034a97
Failed tests:

test/clt-tests/bugs/3075-directory-not-empty-with-flush-ramchunk.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd > /dev/null
––– output –––
––– input –––
if timeout 10 grep -qm1 'accepting connections' <(tail -n 1000 -f /var/log/manticore/searchd.log); then echo 'Accepting connections!'; else echo 'Timeout or failed!'; fi
––– output –––
Accepting connections!
––– input –––
LOG_FILE=$(mktemp)
––– output –––
––– input –––
while true; do
mysql -h0 -P9306 << EOF
INSERT INTO a (id, value) VALUES (0, 'hello world');
EOF
sleep 2
done > /dev/null &
––– output –––
––– input –––
while true; do
mysql -h0 -P9306 << EOF
select * from a where match('world');
EOF
sleep 0.2
done > /dev/null &
––– output –––
––– input –––
while true; do
mysql -h0 -P9306 << EOF
DROP TABLE IF EXISTS b;
CREATE TABLE b (id bigint, value string);
EOF
done > $LOG_FILE &
––– output –––
––– input –––
timeout 10 tail -f $LOG_FILE | while read line; do
if echo "$line" | grep -q "directory is not empty"; then
kill $(jobs -p)
break
fi
done
––– output –––
+ ERROR 1064 (42000) at line 1: unknown local table(s) 'a' in search request

Copy link

clt

❌ CLT tests in test/clt-tests/buddy/
✅ OK: 8
❌ Failed: 1
⏳ Duration: 119s
👉 Check Action Results for commit 8034a97
Failed tests:

test/clt-tests/buddy/test-fuzzy-search.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd > /dev/null; if timeout 10 grep -qm1 '\[BUDDY\] started' <(tail -n 1000 -f /var/log/manticore/searchd.log); then echo 'Buddy started!'; else echo 'Timeout or failed!'; cat /var/log/manticore/searchd.log;fi
––– output –––
Buddy started!
––– input –––
apt-get update -y > /dev/null; echo $?
––– output –––
0
––– input –––
apt-get install jq -y > /dev/null; echo $?
––– output –––
debconf: delaying package configuration, since apt-utils is not installed
0
––– input –––
php -d memory_limit=2G ./test/clt-tests/scripts/load_names_attr.php --batch-size=100000 --concurrency=1 --docs=1000000 --start-id=1 --min-infix-len=2 > /dev/null; echo $?
––– output –––
0
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name ORDER BY id ASC LIMIT 1000000 OPTION max_matches=1000000;" > /tmp/name_data.txt
––– output –––
––– input –––
md5sum /tmp/name_data.txt
––– output –––
1995eec70e60c584bc35ff0688556b94  /tmp/name_data.txt
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE name;" | grep "min_infix_len='2'" | sed "s/.\(min_infix_len='2'\)./\1/"
––– output –––
)min_infix_len='2'expand_keywords='1' |
––– input –––
mysql -h0 -P9306 -e "SELECT COUNT(*) FROM name;"
––– output –––
+----------+
| count(*) |
+----------+
|  1000000 |
+----------+
––– input –––
mysql -h0 -P9306 -e "OPTIMIZE TABLE name OPTION sync=1;"
––– output –––
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('RICH') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+------+---------------------+------+
| id   | username            | s    |
+------+---------------------+------+
|   43 | KOURTNEY RICHARDSON | a    |
|  125 | ELAINA RICHARDSON   | a    |
|  226 | RICHARD ZAMARRIPA   | a    |
|  363 | MAYRA RICO          | a    |
|  840 | RICO MCFADDEN       | a    |
|  855 | RICHARD ALDRIDGE    | a    |
|  934 | VALERY RICH         | a    |
|  948 | REGINE ALDRICH      | a    |
| 1017 | HEE TRICE           | a    |
| 1624 | OLEVIA RICHARDS     | a    |
| 1816 | MAURICE BARCLAY     | a    |
| 2228 | THERESIA RICHARDS   | a    |
| 2670 | JULIANA GRICE       | a    |
| 2918 | GRICELDA WHELAN     | a    |
| 3012 | RICHARD MCCURDY     | a    |
| 3147 | MERRILEE ALDRICH    | a    |
| 3262 | FONDA RICHEY        | a    |
| 3431 | MELANY RICHARD      | a    |
| 3438 | JOVAN ALDRICH       | a    |
| 3517 | BRICE LONGORIA      | a    |
+------+---------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('EBGRNA') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+------+----------------------+------+
| id   | username             | s    |
+------+----------------------+------+
|   20 | BERNARDO DUGGAN      | a    |
|   27 | BERNARDINE BREWER    | a    |
|  209 | KATLYN SERNA         | a    |
| 1292 | LAVERNA CLARK        | a    |
| 1414 | BENNY FERNANDEZ      | a    |
| 1638 | JULENE BERNAL        | a    |
| 2021 | LAVERNA JEFFERSON    | a    |
| 2169 | MERNA ORNELAS        | a    |
| 2471 | BERNADINE SCANLON    | a    |
| 2843 | BERNADINE NAPOLITANO | a    |
| 3177 | FERNANDA FRYER       | a    |
| 3199 | FERNANDO FRANCISCO   | a    |
| 3455 | FERNANDE MERRITT     | a    |
| 3539 | BERNADINE HILLER     | a    |
| 3862 | FERNANDO MACDONALD   | a    |
| 4022 | JOHNSON HERNANDES    | a    |
| 4484 | SYBIL HERNANDES      | a    |
| 5159 | MARTINA BERNARD      | a    |
| 5793 | BERNA TALBOTT        | a    |
| 6506 | FERNANDO FREELAND    | a    |
+------+----------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('ANT') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+------+--------------------+------+
| id   | username           | s    |
+------+--------------------+------+
|    6 | KESHIA RANDAZZO    | a    |
|   12 | TRESA ESCALANTE    | a    |
|   20 | BERNARDO DUGGAN    | a    |
|   31 | DEMETRIA IBANEZ    | a    |
|   32 | PAMELIA SANDLIN    | a    |
|   34 | ANJANETTE MINTON   | a    |
|   40 | ANTONIO RIOS       | a    |
|   62 | ANDRES NATION      | a    |
|   64 | MERI MEDRANO       | a    |
|   65 | JANINA FLANIGAN    | a    |
|   72 | TALISHA SWAN       | a    |
|   75 | JANAY BONNER       | a    |
|   80 | DEMETRIA STANFIELD | a    |
|   81 | RALEIGH SANDBERG   | a    |
|   82 | KRISTIAN MEYER     | a    |
|   83 | JANN HEATH         | a    |
|   87 | RANDEE QUINTERO    | a    |
|   99 | DEAN GUO           | a    |
|  103 | DEAN DEAL          | a    |
|  110 | CONSTANCE REES     | a    |
+------+--------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('tony') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+-------+------------------+------+
| id    | username         | s    |
+-------+------------------+------+
|   688 | SHERIE STORY     | a    |
|  1422 | TOBY CARO        | a    |
|  1627 | RUPERT STORY     | a    |
|  1721 | JOE TONG         | a    |
|  2154 | TONY GREY        | a    |
|  3759 | TOBY GILCHRIST   | a    |
|  5292 | TONA VALENTIN    | a    |
|  5687 | TONY EASTERLING  | a    |
|  5835 | TOBY ROBERSON    | a    |
|  6281 | TOBY ARAIZA      | a    |
|  6962 | TONA DAVIDSON    | a    |
|  7311 | ANTONY STOVALL   | a    |
|  7475 | TOBY REINHART    | a    |
|  8174 | TONA CARRILLO    | a    |
|  8700 | TONA FLETCHER    | a    |
|  8828 | TONYA CALLAHAN   | a    |
|  9251 | TOBY LANGFORD    | a    |
|  9293 | ZENA STORY       | a    |
|  9619 | TONY WHITTINGTON | a    |
| 10167 | LANA STORY       | a    |
+-------+------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMITH') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
+--------+-----------------+------+
| id     | username        | s    |
+--------+-----------------+------+
| 999737 | KEITH STUMP     | a    |
| 999039 | KEITH JAMIESON  | a    |
| 996439 | KEITHA CARBAJAL | a    |
| 995770 | KEITH GONZALES  | a    |
| 990882 | MINH SANTANA    | a    |
| 990643 | KEITH MENDES    | a    |
| 989972 | KEITHA WALTERS  | a    |
| 989954 | GWENN SMYTH     | a    |
| 989444 | KEITH KEATON    | a    |
| 988755 | SHERRON SMYTH   | a    |
| 988366 | LAVONIA SMYTH   | a    |
| 988254 | MAYOLA KEITH    | a    |
| 987106 | KEITH FAULK     | a    |
| 986580 | DARNELL SMYTH   | a    |
| 984012 | KEITH CORONEL   | a    |
| 982759 | MORGAN KEITH    | a    |
| 982421 | KEITH SHIFFLETT | a    |
| 982223 | TELMA KEITH     | a    |
| 982056 | RENITA KEITH    | a    |
| 981115 | KATIE SMYTH     | a    |
+--------+-----------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMYTH') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
+--------+--------------------+------+
| id     | username           | s    |
+--------+--------------------+------+
| 999921 | VICKI SOUTHARD     | a    |
| 998829 | EDYTHE VACA        | a    |
| 998500 | SETH PHUNG         | a    |
| 996507 | SETH LYMAN         | a    |
| 995690 | ROBERTO SOUTHARD   | a    |
| 995663 | CHUNG SOUTH        | a    |
| 995119 | EDYTHE JOHN        | a    |
| 993455 | EDYTH ROSADO       | a    |
| 993278 | LAKITA SOUTHARD    | a    |
| 992097 | EDYTH RAGAN        | a    |
| 989954 | GWENN SMYTH        | a    |
| 988936 | LARISA SOUTHERLAND | a    |
| 988823 | SETH WHITTAKER     | a    |
| 988759 | LIEN SOUTHARD      | a    |
| 988755 | SHERRON SMYTH      | a    |
| 988366 | LAVONIA SMYTH      | a    |
| 987165 | TULA SOUTHARD      | a    |
| 987136 | LUANN SOUTHARD     | a    |
| 986847 | JORDAN SOUTHERN    | a    |
| 986711 | MARLIN SOUTHERN    | a    |
+--------+--------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SMITH') ORDER BY id DESC, username ASC OPTION fuzzy=\"1\";"
––– output –––
ERROR 1064 (42000) at line 1: P01: syntax error, unexpected $undefined near '"1"'
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('john') ORDER BY id DESC, username ASC OPTION fuzzy=1;"
––– output –––
+--------+--------------------+------+
| id     | username           | s    |
+--------+--------------------+------+
| 999971 | RONNA JOHNSON      | a    |
| 999879 | CHARLEY STJOHN     | a    |
| 999685 | JOAN KOESTER       | a    |
| 999655 | JOHN WAINWRIGHT    | a    |
| 999555 | JON MOSIER         | a    |
| 999440 | JOHN LEONG         | a    |
| 999170 | JONELLE HARDING    | a    |
| 999075 | JOHNIE DURAN       | a    |
| 999020 | JONAS HASAN        | a    |
| 998802 | RENETTA LITTLEJOHN | a    |
| 998721 | REY JOHNSTON       | a    |
| 998368 | JONIE MILTON       | a    |
| 998367 | LEENA JOHNSTON     | a    |
| 998128 | SHARILYN JOHNSTON  | a    |
| 997788 | JOANNIE HENSON     | a    |
| 997670 | DENNY JONES        | a    |
| 997623 | JOHNETTA DELATORRE | a    |
| 997577 | JONA CORRAL        | a    |
| 997563 | JONE FOLSOM        | a    |
| 997512 | JOAN CALKINS       | a    |
+--------+--------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('jane') AND id BETWEEN 10000 AND 20000 ORDER BY username ASC OPTION fuzzy=1;"
––– output –––
+-------+----------------------+------+
| id    | username             | s    |
+-------+----------------------+------+
| 10119 | JANIECE GIBSON       | a    |
| 10159 | JANNA MIXON          | a    |
| 10200 | ELANE LOPES          | a    |
| 10205 | JANETTA ZHOU         | a    |
| 10381 | EULALIA LANE         | a    |
| 10465 | JANIE PAXTON         | a    |
| 10492 | JANINA JOE           | a    |
| 10507 | JANNA EDDY           | a    |
| 10635 | JANESSA GOODIN       | a    |
| 10637 | JACQUELYNN JANKOWSKI | a    |
| 10824 | ALEJANDRINA LAUGHLIN | a    |
| 10831 | CLYDE JANES          | a    |
| 10926 | JANNET GOODEN        | a    |
| 10978 | JANAE KELSO          | a    |
| 11064 | JANETH BOWIE         | a    |
| 11266 | MARIELLE ALEJANDRO   | a    |
| 11342 | JANAE DELAGARZA      | a    |
| 11875 | TYLER LUJAN          | a    |
| 11925 | DINAH JANES          | a    |
| 11997 | JANETH BROWNING      | a    |
+-------+----------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('EBGRNA') AND id BETWEEN 1000 AND 2000 ORDER BY username ASC OPTION fuzzy=1;"
––– output –––
+------+-----------------+------+
| id   | username        | s    |
+------+-----------------+------+
| 1292 | LAVERNA CLARK   | a    |
| 1414 | BENNY FERNANDEZ | a    |
| 1638 | JULENE BERNAL   | a    |
+------+-----------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM name WHERE MATCH('SARA') ORDER BY id ASC, username ASC OPTION fuzzy=1;"
––– output –––
+------+----------------------+------+
| id   | username             | s    |
+------+----------------------+------+
|   73 | CLARA NGUYEN         | a    |
| 1285 | CLARA CARTAGENA      | a    |
| 1515 | KLARA ALARCON        | a    |
| 1709 | FREDDA LARA          | a    |
| 2217 | LORIANN DELROSARIO   | a    |
| 2305 | SARA AVILA           | a    |
| 2631 | ROSARIA DELONG       | a    |
| 3245 | LARA MASTERSON       | a    |
| 3267 | LARA MOREAU          | a    |
| 3553 | SARAN CHANG          | a    |
| 3880 | SARAN HOOK           | a    |
| 3980 | GEORGETTA DELROSARIO | a    |
| 4517 | SARAI EASLEY         | a    |
| 5708 | ASA ROSARIO          | a    |
| 5731 | SARITA ANDERS        | a    |
| 6100 | CHANTELL SARABIA     | a    |
| 6165 | SARA HALLMAN         | a    |
| 6480 | SARAH NEILL          | a    |
| 6488 | SARAN PARTIN         | a    |
| 6802 | KLARA ROLLER         | a    |
+------+----------------------+------+
––– input –––
mysql -h0 -P9306 -e "SELECT username FROM name WHERE MATCH('SMITH') OPTION cutoff=0, ranker=expr('sum((4*lcs+2*(min_hit_pos=1)+exact_hit)*user_weight)*1000+bm25'), field_weights=(username=1), fuzzy=1;"
––– output –––
+----------------+
| username       |
+----------------+
| MINH FENNELL   |
| MINH MAZUR     |
| MINH VILLEGAS  |
| MINH TILLER    |
| MINH VOGT      |
| MINH SHAW      |
| MINH STEADMAN  |
| MINH PEAK      |
| MINH ROOT      |
| MINH PATTERSON |
| MINH BURDETTE  |
| MINH ABNEY     |
| MINH DOLAN     |
| MINH RUDD      |
| MINH TOLBERT   |
| MINH CRANDALL  |
| MINH JAIME     |
| MINH ISAACSON  |
| MINH BONILLA   |
| MINH WAHL      |
+----------------+
––– input –––
mysql -h0 -P9306 -e "SELECT username FROM name WHERE MATCH('SMITH') OPTION cutoff=0, field_weights=(username=1), fuzzy=1;"
––– output –––
+-----------------+
| username        |
+-----------------+
| SYDNEY SMYTH    |
| CHERILYN SMYTH  |
| SATURNINA SMYTH |
| LYNN SMYTH      |
| STEVEN SMYTH    |
| JASMIN SMYTH    |
| BERYL SMYTH     |
| JACK SMYTH      |
| CAROLEE SMYTH   |
| CARON SMYTH     |
| ALFREDO SMYTH   |
| ALTA SMYTH      |
| VIKI SMYTH      |
| CHANA SMYTH     |
| HYUN SMYTH      |
| ROGER SMYTH     |
| LINDSEY SMYTH   |
| WILFORD SMYTH   |
| ARLINE SMYTH    |
| APRYL SMYTH     |
+-----------------+
––– input –––
mysql -h0 -P9306 -e "SELECT username FROM name WHERE MATCH('SMITH') OPTION cutoff=0, ranker=expr('sum((4*lcs+2*(min_hit_pos=1)+exact_hit)*user_weight)*1000+bm25'), fuzzy=1;"
––– output –––
+----------------+
| username       |
+----------------+
| MINH FENNELL   |
| MINH MAZUR     |
| MINH VILLEGAS  |
| MINH TILLER    |
| MINH VOGT      |
| MINH SHAW      |
| MINH STEADMAN  |
| MINH PEAK      |
| MINH ROOT      |
| MINH PATTERSON |
| MINH BURDETTE  |
| MINH ABNEY     |
| MINH DOLAN     |
| MINH RUDD      |
| MINH TOLBERT   |
| MINH CRANDALL  |
| MINH JAIME     |
| MINH ISAACSON  |
| MINH BONILLA   |
| MINH WAHL      |
+----------------+
––– input –––
mysql -h0 -P9306 -e "SELECT username FROM name WHERE MATCH('SMITH') OPTION cutoff=0, fuzzy=1;"
––– output –––
+-----------------+
| username        |
+-----------------+
| SYDNEY SMYTH    |
| CHERILYN SMYTH  |
| SATURNINA SMYTH |
| LYNN SMYTH      |
| STEVEN SMYTH    |
| JASMIN SMYTH    |
| BERYL SMYTH     |
| JACK SMYTH      |
| CAROLEE SMYTH   |
| CARON SMYTH     |
| ALFREDO SMYTH   |
| ALTA SMYTH      |
| VIKI SMYTH      |
| CHANA SMYTH     |
| HYUN SMYTH      |
| ROGER SMYTH     |
| LINDSEY SMYTH   |
| WILFORD SMYTH   |
| ARLINE SMYTH    |
| APRYL SMYTH     |
+-----------------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS fuzziness);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 'us,ru' AS layouts);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS append);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 0 AS prepend);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| johnny |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS prepend, 1 AS append);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS fuzziness, '' AS layouts, 1 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 2 AS fuzziness, 'us,ru' AS layouts, 1 AS append, 1 AS prepend, 2 AS expansion_len);" | tail -n +4 | sort
––– output –––
+-------+
| joe   |
| joey  |
| john  |
| jon   |
| jose  |
| joy   |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS append);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS prepend);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 1 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 'us' AS layouts);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('jo', 'name', 'ru' AS layouts);" | tail -n +4 | sort
––– output –––
+--------+
| joe    |
| joey   |
| john   |
| jon    |
| jordan |
| jose   |
| joseph |
| joy    |
| joyce  |
| major  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('al', 'name', 0 AS fuzziness);" | tail -n +4 | sort
––– output –––
+-----------+
| albert    |
| alexander |
| ali       |
| dale      |
| gale      |
| kendall   |
| marshall  |
| palma     |
| valentine |
| walter    |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('mi', 'name', 0 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
~ +----------+
~ | britncami   |
~ | brittanidarci  |
~ | cami  joan   |
~ | choi  jody   |
~ | darcijoe    |
~ | jenni oel   |
~ | joi   ey   |
~ | kaci  john   |
~ | kami    johnie |
~ | kimi    johnny |
~ | laci joi    |
~ | leilanijon    |
~ | luci   jonas  |
~ | mancini jordan |
~ | marci  jorge  |
~ | mi    jose   |
~ | muoi    joseph |
~ | nanci  joshi  |
~ | naomi   joshua |
~ | neomijoy    |
~ | nohemi joyce  |
~ | penni kaci   |
~ | ricci kami   |
~ | roni  kimi   |
~ | shani laci   |
~ | staci luci   |
~ | stefanmarci  |
~ | tami     |
~ | tammi  nanci  |
~ | tiffannaomi  |
~ | toi    neomi  |
~ | tomi    nohemi |
~ | traci  ricci  |
+ | staci  |
+ | tami   |
+ | tammi  |
+ | tobias |
+ | todd   |
+ | toi    |
+ | tom    |
+ | tomas  |
+ | tomi   |
+ | toney  |
+ | traci  |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('ch', 'name', 1 AS fuzziness, 3 AS expansion_len);" | tail -n +4 | sort
––– output –––
+-------+
| chang |
| chong |
| chung |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('зф', 'name', 'us,ru' AS layouts);" | tail -n +4 | sort
––– output –––
+----------+
| page     |
| paige    |
| palma    |
| paris    |
| parker   |
| pat      |
| patricia |
| patrick  |
| paul     |
| paz      |
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('зф', 'name', 'us' AS layouts);" | tail -n +4 | sort
––– output –––
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('gr', 'name', 1 AS fuzziness, 'ru' AS layouts, 1 AS append, 1 AS prepend);" | tail -n +4 | sort
––– output –––
+---------+
| grace   |
| gracia  |
| grady   |
| graham  |
| grant   |
| gregg   |
| gregory |
| grey    |
| grogan  |
| grover  |
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); select * from t where match('somethin') option fuzzy=0;"
––– output –––
––– input –––
mysql -h0 -P9306 -e "select * from t where match('somethin') option fuzzy=0;"
––– output –––
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
+-----------+
| query     |
+-----------+
| some      |
| something |
+-----------+
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
+-----------+
| query     |
+-----------+
| some      |
| something |
+-----------+
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(a int);"
––– output –––
––– input –––
mysql -h0 -P9306 -e "select * from t option fuzzy=1;"
––– output –––
ERROR 1064 (42000) at line 1: The 'fuzzy' option requires a full-text query
––– input –––
mysql -h0 -P9306 -e "drop table if exists comment_28798446; create table comment_28798446(id int, content text) min_infix_len='3';"
––– output –––
––– input –––
mysql -h0 -P9306 -e "insert into comment_28798446 values (1, 'business Manticore interaction'), (2, 'buisness Manticore interation'), (3, 'other text content');"
––– output –––
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('buisness Manticore interation') OPTION fuzzy = 1, layouts = '';"
––– output –––
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('business Manticore interaction') OPTION fuzzy = 1, layouts = '';"
––– output –––
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('Manticore') OPTION fuzzy = 1, layouts = '';"
––– output –––
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', 'ru,us,ua' AS layouts);"
––– output –––
+----------+
| query    |
+----------+
| business |
+----------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', '' AS layouts);"
––– output –––
+----------+
| query    |
+----------+
| business |
+----------+
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); select * from t where match('somethin') option fuzzy=0;"
––– output –––
––– input –––
mysql -h0 -P9306 -e "select * from t where match('somethin') option fuzzy=0;"
––– output –––
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
+-----------+
| query     |
+-----------+
| some      |
| something |
+-----------+
––– input –––
mysql -P9306 -h0 -e "drop table if exists t; create table t(f text) min_infix_len='2'; insert into t values(1, 'something'), (2, 'some thing'); call autocomplete('some', 't');"
––– output –––
+-----------+
| query     |
+-----------+
| some      |
| something |
+-----------+
––– input –––
mysql -h0 -P9306 -e "drop table if exists t; create table t(a int);"
––– output –––
––– input –––
mysql -h0 -P9306 -e "select * from t option fuzzy=1;"
––– output –––
ERROR 1064 (42000) at line 1: The 'fuzzy' option requires a full-text query
––– input –––
mysql -h0 -P9306 -e "drop table if exists comment_28798446; create table comment_28798446(id int, content text) min_infix_len='3';"
––– output –––
––– input –––
mysql -h0 -P9306 -e "insert into comment_28798446 values (1, 'business Manticore interaction'), (2, 'buisness Manticore interation'), (3, 'other text content');"
––– output –––
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('buisness Manticore interation') OPTION fuzzy = 1, layouts = '';"
––– output –––
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('business Manticore interaction') OPTION fuzzy = 1, layouts = '';"
––– output –––
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
––– input –––
mysql -h0 -P9306 -e "SELECT id FROM comment_28798446 WHERE MATCH('Manticore') OPTION fuzzy = 1, layouts = '';"
––– output –––
+------+
| id   |
+------+
|    1 |
|    2 |
+------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', 'ru,us,ua' AS layouts);"
––– output –––
+----------+
| query    |
+----------+
| business |
+----------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('bus', 'comment_28798446', '' AS layouts);"
––– output –––
+----------+
| query    |
+----------+
| business |
+----------+
––– input –––
mysql -h0 -P9306 -e "DROP TABLE IF EXISTS t; DEBUG SLEEP 2; CREATE TABLE t(f TEXT) min_infix_len='2';"
––– output –––
+---------+--------+
| command | result |
+---------+--------+
| sleep   | #!/[0-9]{1}.[0-9]{3}/!#  |
+---------+--------+
––– input –––
mysql -h0 -P9306 -e "INSERT INTO t VALUES (1, 'abcdef'), (2, 'abcd efgh');"
––– output –––
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('abcdef'); SHOW META;"
––– output –––
+------+--------+
| id   | f      |
+------+--------+
|    1 | abcdef |
+------+--------+
+----------------+--------+
| Variable_name  | Value  |
+----------------+--------+
| total          | 1      |
| total_found    | 1      |
| total_relation | eq     |
| time           | #!/[0-9]{1}.[0-9]{3}/!#  |
| keyword[0]     | abcdef |
| docs[0]        | 1      |
| hits[0]        | 1      |
+----------------+--------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('abcef') OPTION fuzzy=1; SHOW META;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    1 | abcdef    |
|    2 | abcd efgh |
+------+-----------+
+----------------+-------+
| Variable_name  | Value |
+----------------+-------+
| total          | 2     |
| total_found    | 2     |
| total_relation | eq    |
| time           | #!/[0-9]{1}.[0-9]{3}/!# |
+----------------+-------+
––– input –––
grep -A3 "SELECT \* FROM t WHERE MATCH('abcdef')" /var/log/manticore/query.log
––– output –––
/* #!/[A-Za-z]{3}\s+[A-Za-z]{3}\s+[0-9]{1,2}\s+[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\s+[0-9]{4}/!# conn %{NUMBER} (127.0.0.1:%{NUMBER}) real #!/[0-9]{1}.[0-9]{3}/!# wall #!/[0-9]{1}.[0-9]{3}/!# found 1 */ SELECT * FROM t WHERE MATCH('abcdef');
/* #!/[A-Za-z]{3}\s+[A-Za-z]{3}\s+[0-9]{1,2}\s+[0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\s+[0-9]{4}/!# conn %{NUMBER} (127.0.0.1:%{NUMBER}) real #!/[0-9]{1}.[0-9]{3}/!# wall #!/[0-9]{1}.[0-9]{3}/!# found 2 */ SELECT * FROM t WHERE MATCH('abcef') OPTION fuzzy=1;
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('nonexistent'); SHOW META;"
––– output –––
+----------------+-------------+
| Variable_name  | Value       |
+----------------+-------------+
| total          | 0           |
| total_found    | 0           |
| total_relation | eq          |
| time           | #!/[0-9]{1}.[0-9]{3}/!#       |
| keyword[0]     | nonexistent |
| docs[0]        | 0           |
| hits[0]        | 0           |
+----------------+-------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('abcdef') OPTION fuzzy=1;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    1 | abcdef    |
|    2 | abcd efgh |
+------+-----------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM t WHERE MATCH('\$#@\!') OPTION fuzzy=1;"
––– output –––
––– input –––
mysql -h0 -P9306 -e "DROP TABLE IF EXISTS idx1; CREATE TABLE idx1(value TEXT) min_infix_len='2';"; echo $?
––– output –––
0
––– input –––
mysql -h0 -P9306 -e "INSERT INTO idx1(value) VALUES ('340');"; echo $?
––– output –––
0
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('34', 'idx1');"
––– output –––
+-------+
| query |
+-------+
| 340   |
+-------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('3', 'idx1');"; echo $?
––– output –––
0
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('34', 'idx1', 1 AS fuzziness);"
––– output –––
+-------+
| query |
+-------+
| 340   |
+-------+
––– input –––
echo -e "searchd {\nlisten = 9306:mysql\nlisten = 9312\nlisten = 9308:http\nlog = /tmp/searchd.log\nquery_log = /tmp/query.log\npid_file = /tmp/searchd.pid\n}\n\nsource src_idx {\ntype = tsvpipe\ntsvpipe_command = cat /tmp/data.tsv\ntsvpipe_field_string = f\ntsvpipe_attr_bigint = id\n}\n\nindex idx_plain {\ntype = plain\nsource = src_idx\npath = /tmp/idx_plain\nmin_infix_len = 2\n}" > /tmp/manticore_idx.conf; echo $?
––– output –––
0
––– input –––
echo -e "1\tabcdef\n2\tabcd efgh\n3\trandom text" > /tmp/data.tsv; echo $?
––– output –––
0
––– input –––
mkdir -p /tmp/idx_plain && chmod 777 /tmp/idx_plain; echo $?
––– output –––
0
––– input –––
indexer --all --config /tmp/manticore_idx.conf > /dev/null 2>&1; echo $?
––– output –––
0
––– input –––
rm -f /tmp/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; (stdbuf -oL searchd -c /tmp/manticore_idx.conf 2>&1 | tee /tmp/searchd.log | grep -i precach & disown); sleep 0.5; if timeout 10 grep -qm1 '\[BUDDY\] started' /tmp/searchd.log; then echo 'Buddy started!'; else echo 'Timeout or failed!'; cat /tmp/searchd.log; fi
––– output –––
precaching table 'idx_plain'
precached 1 tables in #!/[0-9]{1,2}.[0-9]+/!# sec
Buddy started!
––– input –––
mysql -h0 -P9306 -e "SHOW TABLES;"
––– output –––
+-----------+-------+
| Table     | Type  |
+-----------+-------+
| idx_plain | local |
+-----------+-------+
––– input –––
mysql -h0 -P9306 -e "SHOW TABLE idx_plain SETTINGS;"
––– output –––
+---------------+-------------------+
| Variable_name | Value             |
+---------------+-------------------+
| settings      | min_infix_len = 2 |
+---------------+-------------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcdef') OPTION fuzzy=1;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    1 | abcdef    |
|    2 | abcd efgh |
+------+-----------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcef') OPTION fuzzy=1;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    1 | abcdef    |
|    2 | abcd efgh |
+------+-----------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('nonexistent') OPTION fuzzy=1;"
––– output –––
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('abc', 'idx_plain');"
––– output –––
+--------+
| query  |
+--------+
| abcd   |
| abcdef |
+--------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('ran', 'idx_plain');"
––– output –––
+--------+
| query  |
+--------+
| random |
+--------+
––– input –––
mysql -h0 -P9306 -e "CALL AUTOCOMPLETE('zzz', 'idx_plain');"; echo $?
––– output –––
0
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcdef') OPTION fuzzy=0;"
––– output –––
+------+--------+
| id   | f      |
+------+--------+
|    1 | abcdef |
+------+--------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM idx_plain WHERE MATCH('abcd efgh') OPTION fuzzy=0;"
––– output –––
+------+-----------+
| id   | f         |
+------+-----------+
|    2 | abcd efgh |
+------+-----------+

Copy link

clt

❌ CLT tests in test/clt-tests/core/ test/clt-tests/expected-errors/
✅ OK: 37
❌ Failed: 1
⏳ Duration: 393s
👉 Check Action Results for commit 8034a97
Failed tests:

test/clt-tests/core/test-replace-into.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd > /dev/null
––– output –––
––– input –––
if timeout 10 grep -qm1 'accepting connections' <(tail -n 1000 -f /var/log/manticore/searchd.log); then echo 'Accepting connections!'; else echo 'Timeout or failed!'; fi
––– output –––
Accepting connections!
––– input –––
mysql -v -h0 -P9306 -e "SHOW TABLES; DROP TABLE IF EXISTS tbl; SHOW TABLES; CREATE TABLE tbl (id BIGINT, model TEXT, storage_capacity INTEGER, color string, release_year INTEGER, price FLOAT, discounted_price FLOAT, sold BOOL, date_added TIMESTAMP, product_codes MULTI, values MULTI64, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2');"
––– output –––
--------------
SHOW TABLES
--------------
--------------
DROP TABLE IF EXISTS tbl
--------------
--------------
SHOW TABLES
--------------
--------------
CREATE TABLE tbl (id BIGINT, model TEXT, storage_capacity INTEGER, color string, release_year INTEGER, price FLOAT, discounted_price FLOAT, sold BOOL, date_added TIMESTAMP, product_codes MULTI, values MULTI64, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')
--------------
––– input –––
chmod +x ./test/clt-tests/scripts/generate-1mln-records.sh
––– output –––
––– input –––
total_iterations=20000 ./test/clt-tests/scripts/generate-1mln-records.sh
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| tbl   | rt   |
+-------+------+
+----------+
| count(*) |
+----------+
|  1000000 |
+----------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 15 PRO' WHERE id = 101; select * from tbl WHERE id = 101;"
––– output –––
+------+---------------+------------------+--------+--------------+-------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
| id   | model         | storage_capacity | color  | release_year | price       | discounted_price | sold | date_added | product_codes | values                                 | additional_info                                                                   | vector                              |
+------+---------------+------------------+--------+--------------+-------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
|  101 | iPhone 15 PRO |              256 | silver |         2021 | 1099.989990 |       989.989990 |    1 | 2224442480 | 1,2,3         | 523456764345678976,9223372036854775807 | {"features":["ProMotion display","A15 Bionic chip","Ceramic Shield front cover"]} | 0.773448,0.312478,0.137971,0.459821 |
+------+---------------+------------------+--------+--------------+-------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET values = (623456764345678976, 9223372036854775807) WHERE id = 120; select * from tbl WHERE id = 120;"
––– output –––
+------+---------+------------------+-------------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
| id   | model   | storage_capacity | color       | release_year | price      | discounted_price | sold | date_added | product_codes | values                                 | additional_info                                                                   | vector                              |
+------+---------+------------------+-------------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
|  120 | LG Wing |              256 | aurora gray |         2020 | 999.989990 |       899.989990 |    1 | 1496660080 | 57,58,59      | 623456764345678976,9223372036854775807 | {"features":["Qualcomm Snapdragon 765G","Swivel display","Triple-camera system"]} | 0.863448,0.402478,0.227971,0.549821 |
+------+---------+------------------+-------------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET product_codes = (53,45,77), values = (92233777368548,92233720368548) WHERE id = 119; select * from tbl WHERE id = 119;"
––– output –––
+------+---------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
| id   | model               | storage_capacity | color | release_year | price      | discounted_price | sold | date_added | product_codes | values                        | additional_info                                                                   | vector                              |
+------+---------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
|  119 | BlackBerry Evolve X |               64 | black |         2018 | 599.989990 |       499.989990 |    0 | 3697138672 | 45,53,77      | 92233720368548,92233777368548 | {"features":["Qualcomm Snapdragon 660","5.99-inch display","Dual-camera system"]} | 0.051106,0.948278,0.291892,0.104594 |
+------+---------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET price =15000.99 WHERE id = 117; select * from tbl WHERE id = 117;"
––– output –––
+------+----------------------+------------------+---------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
| id   | model                | storage_capacity | color         | release_year | price        | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                                | vector                              |
+------+----------------------+------------------+---------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
|  117 | Motorola Edge 20 Pro |              256 | midnight blue |         2021 | 15000.990234 |       599.989990 |    0 | 1501096560 | 48,49,50      | 1123456764345678976,9223372036854775807 | {"features":["Qualcomm Snapdragon 870","OLED display","Triple-camera system"]} | 0.041106,0.938278,0.281892,0.094594 |
+------+----------------------+------------------+---------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET price =15000.99, discounted_price =445.88 WHERE id = 330; select * from tbl WHERE id = 330;"
––– output –––
+------+------------------------------+------------------+------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+---------------------------------------------------------------------------+-------------------------------------+
| id   | model                        | storage_capacity | color      | release_year | price        | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                           | vector                              |
+------+------------------------------+------------------+------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+---------------------------------------------------------------------------+-------------------------------------+
|  330 | Motorola Moto G Power (2021) |               64 | flash gray |         2021 | 15000.990234 |       445.880005 |    1 | 1306783344 | 84,85,86      | 2323456764345678976,9223372036854775807 | {"features":["Snapdragon 662","6.6-inch display","Triple-camera system"]} | 0.663448,0.202478,0.027971,0.349821 |
+------+------------------------------+------------------+------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+---------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET vector= (-0.037794, 0.856278, 0.202892, 0.015594) WHERE id = 102; select * from tbl WHERE id = 102;"
––– output –––
+------+-----------+------------------+-------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+------------------------------------------------------------------------------------+--------------------------------------+
| id   | model     | storage_capacity | color | release_year | price      | discounted_price | sold | date_added | product_codes | values                                 | additional_info                                                                    | vector                               |
+------+-----------+------------------+-------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+------------------------------------------------------------------------------------+--------------------------------------+
|  102 | iPhone 13 |              128 | blue  |         2021 | 799.989990 |       719.989990 |    0 | 1820294112 | 4,5,6         | 623456764345678976,9223372036854775807 | {"features":["A15 Bionic chip","Ceramic Shield front cover","Dual-camera system"]} | -0.037794,0.856278,0.202892,0.015594 |
+------+-----------+------------------+-------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+------------------------------------------------------------------------------------+--------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET price =15000.99, discounted_price =445.88, vector= (-0.037794, 0.856278, 0.202892, 0.015594) WHERE id = 336; select * from tbl WHERE id = 336;"
––– output –––
+------+----------------------+------------------+-------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+--------------------------------------+
| id   | model                | storage_capacity | color | release_year | price        | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                             | vector                               |
+------+----------------------+------------------+-------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+--------------------------------------+
|  336 | HTC Wildfire E1 lite |               32 | black |         2021 | 15000.990234 |       445.880005 |    1 | 3438054384 | 102,103,104   | 2923456764345678976,9223372036854775807 | {"features":["MediaTek Helio A20","6.1-inch display","Dual-camera system"]} | -0.037794,0.856278,0.202892,0.015594 |
+------+----------------------+------------------+-------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+--------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model='iPhone 13 Pro Max', color='titan', storage_capacity=1000, release_year=2023, sold=1, date_added=4077861360, product_codes=(30,31,32), values= (9223372444854775807,9223372036812375244), additional_info= '{\"features\":[\"Snapdragon 900\",\"8.0-inch display\",\"Dual-camera new-system\"]}', vector= (-0.037795, 0.856278, 0.202892, -0.015595) WHERE id = 247; select * from tbl WHERE id = 247;"
––– output –––
+------+-------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+
| id   | model             | storage_capacity | color | release_year | price      | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                             | vector                                |
+------+-------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+
|  247 | iPhone 13 Pro Max |             1000 | titan |         2023 | 799.989990 |       699.989990 |    1 | 4077861360 | 30,31,32      | 9223372036812375244,9223372036854775807 | {"features":["Snapdragon 900","8.0-inch display","Dual-camera new-system"]} | -0.037795,0.856278,0.202892,-0.015595 |
+------+-------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET additional_info= '{\"features\":[\"Snapdragon 900\",\"8.0-inch display\",\"Dual-camera new-system\"]}' WHERE id = 323; select * from tbl WHERE id =323;"
––– output –––
+------+------------------+------------------+---------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+-------------------------------------+
| id   | model            | storage_capacity | color         | release_year | price      | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                             | vector                              |
+------+------------------+------------------+---------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+-------------------------------------+
|  323 | Asus ROG Phone 5 |              256 | phantom black |         2021 | 999.989990 |       899.989990 |    0 | 3632367600 | 66,67,68      | 1723456764345678976,9223372036854775807 | {"features":["Snapdragon 900","8.0-inch display","Dual-camera new-system"]} | 0.071106,0.968278,0.311892,0.124594 |
+------+------------------+------------------+---------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "Replace Into tbl Set price =15780.99, discounted_price =335.88 WHERE id = 335; select * from tbl WHERE id = 335;"
––– output –––
+------+-------------+------------------+--------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-------------------------------------------------------------------------+---------------------------------------+
| id   | model       | storage_capacity | color        | release_year | price        | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                         | vector                                |
+------+-------------+------------------+--------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-------------------------------------------------------------------------+---------------------------------------+
|  335 | LG G8 ThinQ |              128 | aurora black |         2019 | 15780.990234 |       335.880005 |    0 | 1194467680 | 99,100,101    | 2823456764345678976,9223372036854775807 | {"features":["Snapdragon 855","6.1-inch display","Dual-camera system"]} | -0.118894,0.778278,0.121892,-0.065406 |
+------+-------------+------------------+--------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-------------------------------------------------------------------------+---------------------------------------+
––– input –––
curl -s -X  POST "http://localhost:9308/tbl/_update/101" -H "Content-Type: application/json" -d '{"doc": {"model": "new-model", "color": "new-color"}}'; echo $?
––– output –––
{"_index":"tbl","updated":1}0
––– input –––
start_time=$(date +%s%3N) && for i in {1..5000}; do echo "REPLACE INTO tbl SET color = 'color_$i' WHERE id = ${i}01;"; done > /tmp/replace_dump && mysql -h0 -P9306 < /tmp/replace_dump > /dev/null && end_time=$(date +%s%3N) && export elapsed_time=$((end_time - start_time))
––– output –––
––– input –––
echo $elapsed_time
––– output –––
#!/[0-9]{4,5}/!#
––– input –––
mysql -h0 -P9306 -e "select count(*) from tbl WHERE regex (color, 'color_[0-9]+')"
––– output –––
+----------+
| count(*) |
+----------+
|     5000 |
+----------+
––– input –––
start_time2=$(date +%s%3N) && for i in {1..5000}; do echo "REPLACE INTO tbl (id, model, storage_capacity, color, release_year, price, discounted_price, sold, date_added, product_codes, values, additional_info, vector) VALUES (${i}101, 'iPhone 13 Pro', 256, 'silver${i}', 2021, 1099.99, 989.99, 'TRUE', '1591362342000', (1,2,3), (523456764345678976, 98765409877866654098, 1109876543450987650987), '{\"features\": [\"ProMotion display\", \"A15 Bionic chip\", \"Ceramic Shield front cover\"]}', (0.773448, 0.312478, 0.137971, 0.459821));"; done > /tmp/replace_dump && mysql -h0 -P9306 < /tmp/replace_dump > /dev/null && end_time2=$(date +%s%3N) && export elapsed_time2=$((end_time2 - start_time2))
––– output –––
––– input –––
echo $elapsed_time2
––– output –––
#!/[0-9]{3,4}/!#
––– input –––
mysql -h0 -P9306 -e "select count(*) from tbl WHERE regex (color, 'silver[0-9]+')"
––– output –––
+----------+
| count(*) |
+----------+
|     5000 |
+----------+
––– input –––
echo $((elapsed_time / elapsed_time2))
––– output –––
#!/([0-9]{1}|1[0-2]{1})/!#
––– input –––
mysql -v -h0 -P9306 -e "SHOW TABLES; DROP TABLE IF EXISTS abc; create table abc(id, t1 text, t2 text indexed); insert into abc VALUES (1, 'abc', 'cde'); desc abc;"
––– output –––
--------------
SHOW TABLES
--------------
+-------+------+
| Table | Type |
+-------+------+
| tbl   | rt   |
+-------+------+
--------------
DROP TABLE IF EXISTS abc
--------------
--------------
create table abc(id, t1 text, t2 text indexed)
--------------
--------------
insert into abc VALUES (1, 'abc', 'cde')
--------------
--------------
desc abc
--------------
+-------+--------+----------------+
| Field | Type   | Properties     |
+-------+--------+----------------+
| id    | bigint |                |
| t1    | text   | indexed stored |
| t2    | text   | indexed        |
+-------+--------+----------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO abc SET t1 ='iPhone 15 PRO' WHERE id = 1;"
––– output –––
ERROR 1064 (42000) at line 1: Field t2 doesn't have stored property. Replace query can't be performed
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 16 PRO MAX' WHERE id > 105;"
––– output –––
ERROR 1064 (42000) at line 1: P01: syntax error, unexpected SET, expecting VALUES near 'SET model ='iPhone 16 PRO MAX' WHERE id > 105'
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 17 PRO MAX' WHERE id = 'abs';"
––– output –––
ERROR 1064 (42000) at line 1: P01: syntax error, unexpected SET, expecting VALUES near 'SET model ='iPhone 17 PRO MAX' WHERE id = 'abs''
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 18 PRO' WHERE id in (1,2,3);"
––– output –––
ERROR 1064 (42000) at line 1: P01: syntax error, unexpected SET, expecting VALUES near 'SET model ='iPhone 18 PRO' WHERE id in (1,2,3)'
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 18 PRO' WHERE sold = 0;"
––– output –––
ERROR 1064 (42000) at line 1: P01: syntax error, unexpected SET, expecting VALUES near 'SET model ='iPhone 18 PRO' WHERE sold = 0'
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET id =777 WHERE id = 144; select * from tbl WHERE id = 144;"
––– output –––
+------+-----------------+------------------+--------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------+-------------------------------------+
| id   | model           | storage_capacity | color        | release_year | price      | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                    | vector                              |
+------+-----------------+------------------+--------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------+-------------------------------------+
|  144 | Sony Xperia XZ3 |               64 | forest green |         2018 | 899.989990 |       799.989990 |    1 | 3308512240 | 126,127,128   | 3723456764345678976,9223372036854775807 | {"features":["Snapdragon 845","6.0-inch display","Single camera"]} | 0.733448,0.272478,0.097971,0.419821 |
+------+-----------------+------------------+--------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -v -h0 -P9306 -e "SHOW TABLES; DROP TABLE IF EXISTS tbl; DROP TABLE IF EXISTS abc; SHOW TABLES; CREATE TABLE tbl (id BIGINT, model TEXT, storage_capacity INTEGER, color string, release_year INTEGER, price FLOAT, discounted_price FLOAT, sold BOOL, date_added TIMESTAMP, product_codes MULTI, values MULTI64, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2') engine='columnar';"
––– output –––
--------------
SHOW TABLES
--------------
+-------+------+
| Table | Type |
+-------+------+
| abc   | rt   |
| tbl   | rt   |
+-------+------+
--------------
DROP TABLE IF EXISTS tbl
--------------
--------------
DROP TABLE IF EXISTS abc
--------------
--------------
SHOW TABLES
--------------
--------------
CREATE TABLE tbl (id BIGINT, model TEXT, storage_capacity INTEGER, color string, release_year INTEGER, price FLOAT, discounted_price FLOAT, sold BOOL, date_added TIMESTAMP, product_codes MULTI, values MULTI64, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2') engine='columnar'
--------------
––– input –––
chmod +x ./test/clt-tests/scripts/generate-1mln-records.sh
––– output –––
––– input –––
total_iterations=20000 ./test/clt-tests/scripts/generate-1mln-records.sh
––– output –––
+-------+------+
| Table | Type |
+-------+------+
| tbl   | rt   |
+-------+------+
+----------+
| count(*) |
+----------+
|  1000000 |
+----------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 15 PRO' WHERE id = 101; select * from tbl WHERE id = 101;"
––– output –––
+------+---------------+------------------+--------+--------------+-------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
| id   | model         | storage_capacity | color  | release_year | price       | discounted_price | sold | date_added | product_codes | values                                 | additional_info                                                                   | vector                              |
+------+---------------+------------------+--------+--------------+-------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
|  101 | iPhone 15 PRO |              256 | silver |         2021 | 1099.989990 |       989.989990 |    1 | 2224442480 | 1,2,3         | 523456764345678976,9223372036854775807 | {"features":["ProMotion display","A15 Bionic chip","Ceramic Shield front cover"]} | 0.773448,0.312478,0.137971,0.459821 |
+------+---------------+------------------+--------+--------------+-------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET values = (623456764345678976, 9223372036854775807) WHERE id = 120; select * from tbl WHERE id = 120;"
––– output –––
+------+---------+------------------+-------------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
| id   | model   | storage_capacity | color       | release_year | price      | discounted_price | sold | date_added | product_codes | values                                 | additional_info                                                                   | vector                              |
+------+---------+------------------+-------------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
|  120 | LG Wing |              256 | aurora gray |         2020 | 999.989990 |       899.989990 |    1 | 1496660080 | 57,58,59      | 623456764345678976,9223372036854775807 | {"features":["Qualcomm Snapdragon 765G","Swivel display","Triple-camera system"]} | 0.863448,0.402478,0.227971,0.549821 |
+------+---------+------------------+-------------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET product_codes = (53,45,77), values = (92233777368548,92233720368548) WHERE id = 119; select * from tbl WHERE id = 119;"
––– output –––
+------+---------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
| id   | model               | storage_capacity | color | release_year | price      | discounted_price | sold | date_added | product_codes | values                        | additional_info                                                                   | vector                              |
+------+---------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
|  119 | BlackBerry Evolve X |               64 | black |         2018 | 599.989990 |       499.989990 |    0 | 3697138672 | 45,53,77      | 92233720368548,92233777368548 | {"features":["Qualcomm Snapdragon 660","5.99-inch display","Dual-camera system"]} | 0.051106,0.948278,0.291892,0.104594 |
+------+---------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-------------------------------+-----------------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET price =15000.99 WHERE id = 117; select * from tbl WHERE id = 117;"
––– output –––
+------+----------------------+------------------+---------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
| id   | model                | storage_capacity | color         | release_year | price        | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                                | vector                              |
+------+----------------------+------------------+---------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
|  117 | Motorola Edge 20 Pro |              256 | midnight blue |         2021 | 15000.990234 |       599.989990 |    0 | 1501096560 | 48,49,50      | 1123456764345678976,9223372036854775807 | {"features":["Qualcomm Snapdragon 870","OLED display","Triple-camera system"]} | 0.041106,0.938278,0.281892,0.094594 |
+------+----------------------+------------------+---------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET price =15000.99, discounted_price =445.88 WHERE id = 330; select * from tbl WHERE id = 330;"
––– output –––
+------+------------------------------+------------------+------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+---------------------------------------------------------------------------+-------------------------------------+
| id   | model                        | storage_capacity | color      | release_year | price        | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                           | vector                              |
+------+------------------------------+------------------+------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+---------------------------------------------------------------------------+-------------------------------------+
|  330 | Motorola Moto G Power (2021) |               64 | flash gray |         2021 | 15000.990234 |       445.880005 |    1 | 1306783344 | 84,85,86      | 2323456764345678976,9223372036854775807 | {"features":["Snapdragon 662","6.6-inch display","Triple-camera system"]} | 0.663448,0.202478,0.027971,0.349821 |
+------+------------------------------+------------------+------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+---------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET vector= (-0.037794, 0.856278, 0.202892, 0.015594) WHERE id = 102; select * from tbl WHERE id = 102;"
––– output –––
+------+-----------+------------------+-------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+------------------------------------------------------------------------------------+--------------------------------------+
| id   | model     | storage_capacity | color | release_year | price      | discounted_price | sold | date_added | product_codes | values                                 | additional_info                                                                    | vector                               |
+------+-----------+------------------+-------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+------------------------------------------------------------------------------------+--------------------------------------+
|  102 | iPhone 13 |              128 | blue  |         2021 | 799.989990 |       719.989990 |    0 | 1820294112 | 4,5,6         | 623456764345678976,9223372036854775807 | {"features":["A15 Bionic chip","Ceramic Shield front cover","Dual-camera system"]} | -0.037794,0.856278,0.202892,0.015594 |
+------+-----------+------------------+-------+--------------+------------+------------------+------+------------+---------------+----------------------------------------+------------------------------------------------------------------------------------+--------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET price =15000.99, discounted_price =445.88, vector= (-0.037794, 0.856278, 0.202892, 0.015594) WHERE id = 336; select * from tbl WHERE id = 336;"
––– output –––
+------+----------------------+------------------+-------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+--------------------------------------+
| id   | model                | storage_capacity | color | release_year | price        | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                             | vector                               |
+------+----------------------+------------------+-------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+--------------------------------------+
|  336 | HTC Wildfire E1 lite |               32 | black |         2021 | 15000.990234 |       445.880005 |    1 | 3438054384 | 102,103,104   | 2923456764345678976,9223372036854775807 | {"features":["MediaTek Helio A20","6.1-inch display","Dual-camera system"]} | -0.037794,0.856278,0.202892,0.015594 |
+------+----------------------+------------------+-------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+--------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model='iPhone 13 Pro Max', color='titan', storage_capacity=1000, release_year=2023, sold=1, date_added=4077861360, product_codes=(30,31,32), values= (9223372444854775807,9223372036812375244), additional_info= '{\"features\":[\"Snapdragon 900\",\"8.0-inch display\",\"Dual-camera new-system\"]}', vector= (-0.037795, 0.856278, 0.202892, -0.015595) WHERE id = 247; select * from tbl WHERE id = 247;"
––– output –––
+------+-------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+
| id   | model             | storage_capacity | color | release_year | price      | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                             | vector                                |
+------+-------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+
|  247 | iPhone 13 Pro Max |             1000 | titan |         2023 | 799.989990 |       699.989990 |    1 | 4077861360 | 30,31,32      | 9223372036812375244,9223372036854775807 | {"features":["Snapdragon 900","8.0-inch display","Dual-camera new-system"]} | -0.037795,0.856278,0.202892,-0.015595 |
+------+-------------------+------------------+-------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET additional_info= '{\"features\":[\"Snapdragon 900\",\"8.0-inch display\",\"Dual-camera new-system\"]}' WHERE id = 323; select * from tbl WHERE id =323;"
––– output –––
+------+------------------+------------------+---------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+-------------------------------------+
| id   | model            | storage_capacity | color         | release_year | price      | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                             | vector                              |
+------+------------------+------------------+---------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+-------------------------------------+
|  323 | Asus ROG Phone 5 |              256 | phantom black |         2021 | 999.989990 |       899.989990 |    0 | 3632367600 | 66,67,68      | 1723456764345678976,9223372036854775807 | {"features":["Snapdragon 900","8.0-inch display","Dual-camera new-system"]} | 0.071106,0.968278,0.311892,0.124594 |
+------+------------------+------------------+---------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+-----------------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "Replace Into tbl Set price =15780.99, discounted_price =335.88 WHERE id = 335; select * from tbl WHERE id = 335;"
––– output –––
+------+-------------+------------------+--------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-------------------------------------------------------------------------+---------------------------------------+
| id   | model       | storage_capacity | color        | release_year | price        | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                         | vector                                |
+------+-------------+------------------+--------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-------------------------------------------------------------------------+---------------------------------------+
|  335 | LG G8 ThinQ |              128 | aurora black |         2019 | 15780.990234 |       335.880005 |    0 | 1194467680 | 99,100,101    | 2823456764345678976,9223372036854775807 | {"features":["Snapdragon 855","6.1-inch display","Dual-camera system"]} | -0.118894,0.778278,0.121892,-0.065406 |
+------+-------------+------------------+--------------+--------------+--------------+------------------+------+------------+---------------+-----------------------------------------+-------------------------------------------------------------------------+---------------------------------------+
––– input –––
curl -s -X  POST "http://localhost:9308/tbl/_update/101" -H "Content-Type: application/json" -d '{"doc": {"model": "new-model", "color": "new-color"}}'; echo $?
––– output –––
{"_index":"tbl","updated":1}0
––– input –––
start_time=$(date +%s%3N) && for i in {1..5000}; do echo "REPLACE INTO tbl SET color = 'color_$i' WHERE id = ${i}01;"; done > /tmp/replace_dump && mysql -h0 -P9306 < /tmp/replace_dump > /dev/null && end_time=$(date +%s%3N) && export elapsed_time=$((end_time - start_time))
––– output –––
––– input –––
echo $elapsed_time
––– output –––
#!/[0-9]{4,5}/!#
––– input –––
mysql -h0 -P9306 -e "select count(*) from tbl WHERE regex (color, 'color_[0-9]+')"
––– output –––
+----------+
| count(*) |
+----------+
|     5000 |
+----------+
––– input –––
start_time2=$(date +%s%3N) && for i in {1..5000}; do echo "REPLACE INTO tbl (id, model, storage_capacity, color, release_year, price, discounted_price, sold, date_added, product_codes, values, additional_info, vector) VALUES (${i}101, 'iPhone 13 Pro', 256, 'silver${i}', 2021, 1099.99, 989.99, 'TRUE', '1591362342000', (1,2,3), (523456764345678976, 98765409877866654098, 1109876543450987650987), '{\"features\": [\"ProMotion display\", \"A15 Bionic chip\", \"Ceramic Shield front cover\"]}', (0.773448, 0.312478, 0.137971, 0.459821));"; done > /tmp/replace_dump && mysql -h0 -P9306 < /tmp/replace_dump > /dev/null && end_time2=$(date +%s%3N) && export elapsed_time2=$((end_time2 - start_time2))
––– output –––
––– input –––
echo $elapsed_time2
––– output –––
#!/[0-9]{3,4}/!#
––– input –––
mysql -h0 -P9306 -e "select count(*) from tbl WHERE regex (color, 'silver[0-9]+')"
––– output –––
+----------+
| count(*) |
+----------+
|     5000 |
+----------+
––– input –––
echo $((elapsed_time / elapsed_time2))
––– output –––
- #!/([0-9]{1}|1[0-2]{1})/!#
+ 10
––– input –––
mysql -v -h0 -P9306 -e "SHOW TABLES; create table abc(id, t1 text, t2 text indexed) engine='columnar'; insert into abc VALUES (1, 'abc', 'cde'); desc abc;"
––– output –––
--------------
SHOW TABLES
--------------
+-------+------+
| Table | Type |
+-------+------+
| tbl   | rt   |
+-------+------+
--------------
create table abc(id, t1 text, t2 text indexed) engine='columnar'
--------------
--------------
insert into abc VALUES (1, 'abc', 'cde')
--------------
--------------
desc abc
--------------
+-------+--------+----------------+
| Field | Type   | Properties     |
+-------+--------+----------------+
| id    | bigint | columnar       |
| t1    | text   | indexed stored |
| t2    | text   | indexed        |
+-------+--------+----------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO abc SET t1 ='iPhone 15 PRO' WHERE id = 1;"
––– output –––
ERROR 1064 (42000) at line 1: Field t2 doesn't have stored property. Replace query can't be performed
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 16 PRO MAX' WHERE id > 105;"
––– output –––
ERROR 1064 (42000) at line 1: P01: syntax error, unexpected SET, expecting VALUES near 'SET model ='iPhone 16 PRO MAX' WHERE id > 105'
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 17 PRO MAX' WHERE id = 'abs';"
––– output –––
ERROR 1064 (42000) at line 1: P01: syntax error, unexpected SET, expecting VALUES near 'SET model ='iPhone 17 PRO MAX' WHERE id = 'abs''
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 18 PRO' WHERE id in (1,2,3);"
––– output –––
ERROR 1064 (42000) at line 1: P01: syntax error, unexpected SET, expecting VALUES near 'SET model ='iPhone 18 PRO' WHERE id in (1,2,3)'
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model ='iPhone 18 PRO' WHERE sold = 0;"
––– output –––
ERROR 1064 (42000) at line 1: P01: syntax error, unexpected SET, expecting VALUES near 'SET model ='iPhone 18 PRO' WHERE sold = 0'
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET id =777 WHERE id = 144; select * from tbl WHERE id = 144;"
––– output –––
+------+-----------------+------------------+--------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------+-------------------------------------+
| id   | model           | storage_capacity | color        | release_year | price      | discounted_price | sold | date_added | product_codes | values                                  | additional_info                                                    | vector                              |
+------+-----------------+------------------+--------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------+-------------------------------------+
|  144 | Sony Xperia XZ3 |               64 | forest green |         2018 | 899.989990 |       799.989990 |    1 | 3308512240 | 126,127,128   | 3723456764345678976,9223372036854775807 | {"features":["Snapdragon 845","6.0-inch display","Single camera"]} | 0.733448,0.272478,0.097971,0.419821 |
+------+-----------------+------------------+--------------+--------------+------------+------------------+------+------------+---------------+-----------------------------------------+--------------------------------------------------------------------+-------------------------------------+
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET model = 'Sony Xperia X\'Z3' WHERE id = 144; select * from tbl WHERE id = 144\G"
––– output –––
*************************** 1. row ***************************
id: 144
model: Sony Xperia X'Z3
storage_capacity: 64
color: forest green
release_year: 2018
price: 899.989990
discounted_price: 799.989990
sold: 1
date_added: 3308512240
product_codes: 126,127,128
values: 3723456764345678976,9223372036854775807
additional_info: {"features":["Snapdragon 845","6.0-inch display","Single camera"]}
vector: 0.733448,0.272478,0.097971,0.419821
––– input –––
mysql -h0 -P9306 -e "REPLACE INTO tbl SET release_year = 2019 WHERE id = 144; select * from tbl WHERE id = 144\G"
––– output –––
*************************** 1. row ***************************
id: 144
model: Sony Xperia X'Z3
storage_capacity: 64
color: forest green
release_year: 2019
price: 899.989990
discounted_price: 799.989990
sold: 1
date_added: 3308512240
product_codes: 126,127,128
values: 3723456764345678976,9223372036854775807
additional_info: {"features":["Snapdragon 845","6.0-inch display","Single camera"]}
vector: 0.733448,0.272478,0.097971,0.419821

glookka and others added 6 commits March 19, 2025 11:48
fixed an issue with determining the local time zone on linux
* Added a new case that SELECT does not wait for FREEZE + UPDATE

* Changing manticore-load output to json

---------

Co-authored-by: Pavel_Shilin <[email protected]>
* Created test-update-with-query-log-min-msec.reс

---------

Co-authored-by: Sergey Nikolaev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants