Skip to content

feat: generate auto embeddings in queries#3591

Merged
glookka merged 1 commit into
masterfrom
embeddings_in_queries
Jul 25, 2025
Merged

feat: generate auto embeddings in queries#3591
glookka merged 1 commit into
masterfrom
embeddings_in_queries

Conversation

@glookka

@glookka glookka commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

feat: generate auto embeddings in queries

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/plugins/
✅ OK: 0
❌ Failed: 1
⏳ Duration: 12s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/plugins/test-enable-disable-buddy-plugin.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "create table t (id bigint, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
- ERROR 1064 (42000) at line 1: Plugin 'knn' is disabled
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'

@github-actions

github-actions Bot commented Jul 21, 2025

Copy link
Copy Markdown
Contributor

Windows test results

    3 files      3 suites   24m 37s ⏱️
1 083 tests 1 031 ✅ 52 💤 0 ❌
1 087 runs  1 035 ✅ 52 💤 0 ❌

Results for commit e9e4a55.

♻️ This comment has been updated with latest results.

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/core/ test/clt-tests/expected-errors/
✅ OK: 47
❌ Failed: 2
⏳ Duration: 440s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/core/test-knn-id.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd $SEARCHD_FLAGS > /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 –––
OK
––– input –––
mysql -h0 -P9306 -e "create table test ( title text, image_vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2' );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "insert into test values ( 1, 'yellow bag', (0.653448,0.192478,0.017971,0.339821) ), ( 2, 'white bag', (-0.148894,0.748278,0.091892,-0.095406) );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, (0.286569,-0.031816,0.066684,0.032926), {ef=2000} );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | knn_dist() |
- +------+------------+
- |    2 | 1.14755321 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | title     | image_vector                          | @knn_dist  |
- +------+-----------+---------------------------------------+------------+
- |    2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
- +------+-----------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "select count(*) from test where knn ( image_vector, 5, 1 );"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | count(*) |
- +----------+
- |        2 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, color TEXT, sold BOOL, date_added BIGINT, storage_capacity UINT, release_year UINT, price FLOAT, discounted_price FLOAT, product_codes JSON, values JSON, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, color, sold, date_added, storage_capacity, release_year, price, discounted_price, product_codes, values, additional_info, vector) VALUES (1, 'Model_1', 'Color_1', 1, 1620590570251, 512, 2022, 654.19, 855.34, '[81,56,60]', '[96,389,27]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.1, 0.2, 0.3, 0.4)), (2, 'Model_2', 'Color_2', 1, 1689374130160, 128, 2020, 663.70, 767.99, '[12,39,30]', '[226,305,123]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.286569, -0.031816, 0.066684, 0.032926)), (3, 'Model_3', 'Color_3', 0, 1640782021529, 512, 2020, 676.46, 847.08, '[62,13,4]', '[707,601,608]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.5, 0.7, -0.1, 0.2)), (4, 'Model_4', 'Color_4', 0, 1615319697581, 128, 2020, 424.23, 883.90, '[98,96,89]', '[166,252,510]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.7, -0.8, 0.1, -0.2)), (5, 'Model_5', 'Color_5', 1, 1671157942660, 128, 2021, 1173.29, 977.33, '[27,12,37]', '[988,87,21]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.3, 0.4, 0.5, 0.6)), (6, 'Model_6', 'Color_6', 0, 1609876342571, 256, 2021, 755.99, 665.49, '[5,15,25]', '[15,100,500]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.2, 0.4, -0.6, 0.8)), (7, 'Model_7', 'Color_7', 1, 1648765432160, 64, 2019, 299.99, 199.99, '[77,88,99]', '[99,888,555]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.5, -0.3, 0.9, -0.1)), (8, 'Model_8', 'Color_8', 0, 1654876543130, 256, 2019, 800.99, 699.99, '[22,33,44]', '[66,333,999]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.8, 0.6, 0.2, -0.4)), (9, 'Model_9', 'Color_9', 1, 1631567882541, 128, 2022, 499.99, 399.99, '[11,22,33]', '[111,222,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.1, 0.3, -0.5, 0.7)), (10, 'Model_10', 'Color_10', 0, 1678956543120, 512, 2022, 1299.99, 1099.99, '[9,8,7]', '[555,444,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.9, 0.1, 0.8, -0.2));"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | model    | color    | sold | date_added    | storage_capacity | release_year | price       | discounted_price | product_codes | values        | additional_info                                    | vector                                | @knn_dist  |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
- |    5 | Model_5  | Color_5  |    1 | 1671157942660 |              128 |         2021 | 1173.290039 |       977.330017 | [27,12,37]    | [988,87,21]   | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.300000,0.400000,0.500000,0.600000   | 0.16000001 |
- |    2 | Model_2  | Color_2  |    1 | 1689374130160 |              128 |         2020 |  663.700012 |       767.989990 | [12,39,30]    | [226,305,123] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.286569,-0.031816,0.066684,0.032926  | 0.27772635 |
- |    9 | Model_9  | Color_9  |    1 | 1631567882541 |              128 |         2022 |  499.989990 |       399.989990 | [11,22,33]    | [111,222,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.100000,0.300000,-0.500000,0.700000 | 0.78000003 |
- |    3 | Model_3  | Color_3  |    0 | 1640782021529 |              512 |         2020 |  676.460022 |       847.080017 | [62,13,4]     | [707,601,608] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.500000,0.700000,-0.100000,0.200000 | 0.81000006 |
- |    7 | Model_7  | Color_7  |    1 | 1648765432160 |               64 |         2019 |  299.989990 |       199.990005 | [77,88,99]    | [99,888,555]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.500000,-0.300000,0.900000,-0.100000 |   1.020000 |
- |    6 | Model_6  | Color_6  |    0 | 1609876342571 |              256 |         2021 |  755.989990 |       665.489990 | [5,15,25]     | [15,100,500]  | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.200000,0.400000,-0.600000,0.800000 |   1.100000 |
- |   10 | Model_10 | Color_10 |    0 | 1678956543120 |              512 |         2022 | 1299.989990 |      1099.989990 | [9,8,7]       | [555,444,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.900000,0.100000,0.800000,-0.200000  |   1.260000 |
- |    8 | Model_8  | Color_8  |    0 | 1654876543130 |              256 |         2019 |  800.989990 |       699.989990 | [22,33,44]    | [66,333,999]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.800000,0.600000,0.200000,-0.400000  |   1.300000 |
- |    4 | Model_4  | Color_4  |    0 | 1615319697581 |              128 |         2020 |  424.230011 |       883.900024 | [98,96,89]    | [166,252,510] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.700000,-0.800000,0.100000,-0.200000 | 1.75999987 |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |       10 |
- +----------+
test/clt-tests/core/tets-insert-knn-errors.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test2 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test2 (id, model, vector) VALUES (1, 'Model_1', (0.286569,-0.031816,0.066684,0.032926))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test2 WHERE knn(vector, 10, 1)"
––– output –––
- ERROR 1064 (42000) at line 1: table knn_test2: KNN index not enabled for attribute 'vector'
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test2"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test3 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test3 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test3 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test3"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test4 (id BIGINT, model TEXT, vector int)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test4 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test4 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test4"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test5 (id BIGINT, model TEXT, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test5 (id, model, vector) VALUES (1, 'Model_1', (0.9012, 0.2126, 0.2879, 0.7552))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test5 WHERE knn(vector, 10, 1)"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |        1 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test5"
––– output –––
OK

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/plugins/
✅ OK: 0
❌ Failed: 1
⏳ Duration: 11s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/plugins/test-enable-disable-buddy-plugin.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "create table t (id bigint, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
- ERROR 1064 (42000) at line 1: Plugin 'knn' is disabled
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/core/ test/clt-tests/expected-errors/
✅ OK: 47
❌ Failed: 2
⏳ Duration: 440s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/core/test-knn-id.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd $SEARCHD_FLAGS > /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 –––
OK
––– input –––
mysql -h0 -P9306 -e "create table test ( title text, image_vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2' );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "insert into test values ( 1, 'yellow bag', (0.653448,0.192478,0.017971,0.339821) ), ( 2, 'white bag', (-0.148894,0.748278,0.091892,-0.095406) );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, (0.286569,-0.031816,0.066684,0.032926), {ef=2000} );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | knn_dist() |
- +------+------------+
- |    2 | 1.14755321 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | title     | image_vector                          | @knn_dist  |
- +------+-----------+---------------------------------------+------------+
- |    2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
- +------+-----------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "select count(*) from test where knn ( image_vector, 5, 1 );"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | count(*) |
- +----------+
- |        2 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, color TEXT, sold BOOL, date_added BIGINT, storage_capacity UINT, release_year UINT, price FLOAT, discounted_price FLOAT, product_codes JSON, values JSON, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, color, sold, date_added, storage_capacity, release_year, price, discounted_price, product_codes, values, additional_info, vector) VALUES (1, 'Model_1', 'Color_1', 1, 1620590570251, 512, 2022, 654.19, 855.34, '[81,56,60]', '[96,389,27]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.1, 0.2, 0.3, 0.4)), (2, 'Model_2', 'Color_2', 1, 1689374130160, 128, 2020, 663.70, 767.99, '[12,39,30]', '[226,305,123]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.286569, -0.031816, 0.066684, 0.032926)), (3, 'Model_3', 'Color_3', 0, 1640782021529, 512, 2020, 676.46, 847.08, '[62,13,4]', '[707,601,608]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.5, 0.7, -0.1, 0.2)), (4, 'Model_4', 'Color_4', 0, 1615319697581, 128, 2020, 424.23, 883.90, '[98,96,89]', '[166,252,510]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.7, -0.8, 0.1, -0.2)), (5, 'Model_5', 'Color_5', 1, 1671157942660, 128, 2021, 1173.29, 977.33, '[27,12,37]', '[988,87,21]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.3, 0.4, 0.5, 0.6)), (6, 'Model_6', 'Color_6', 0, 1609876342571, 256, 2021, 755.99, 665.49, '[5,15,25]', '[15,100,500]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.2, 0.4, -0.6, 0.8)), (7, 'Model_7', 'Color_7', 1, 1648765432160, 64, 2019, 299.99, 199.99, '[77,88,99]', '[99,888,555]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.5, -0.3, 0.9, -0.1)), (8, 'Model_8', 'Color_8', 0, 1654876543130, 256, 2019, 800.99, 699.99, '[22,33,44]', '[66,333,999]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.8, 0.6, 0.2, -0.4)), (9, 'Model_9', 'Color_9', 1, 1631567882541, 128, 2022, 499.99, 399.99, '[11,22,33]', '[111,222,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.1, 0.3, -0.5, 0.7)), (10, 'Model_10', 'Color_10', 0, 1678956543120, 512, 2022, 1299.99, 1099.99, '[9,8,7]', '[555,444,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.9, 0.1, 0.8, -0.2));"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | model    | color    | sold | date_added    | storage_capacity | release_year | price       | discounted_price | product_codes | values        | additional_info                                    | vector                                | @knn_dist  |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
- |    5 | Model_5  | Color_5  |    1 | 1671157942660 |              128 |         2021 | 1173.290039 |       977.330017 | [27,12,37]    | [988,87,21]   | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.300000,0.400000,0.500000,0.600000   | 0.16000001 |
- |    2 | Model_2  | Color_2  |    1 | 1689374130160 |              128 |         2020 |  663.700012 |       767.989990 | [12,39,30]    | [226,305,123] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.286569,-0.031816,0.066684,0.032926  | 0.27772635 |
- |    9 | Model_9  | Color_9  |    1 | 1631567882541 |              128 |         2022 |  499.989990 |       399.989990 | [11,22,33]    | [111,222,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.100000,0.300000,-0.500000,0.700000 | 0.78000003 |
- |    3 | Model_3  | Color_3  |    0 | 1640782021529 |              512 |         2020 |  676.460022 |       847.080017 | [62,13,4]     | [707,601,608] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.500000,0.700000,-0.100000,0.200000 | 0.81000006 |
- |    7 | Model_7  | Color_7  |    1 | 1648765432160 |               64 |         2019 |  299.989990 |       199.990005 | [77,88,99]    | [99,888,555]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.500000,-0.300000,0.900000,-0.100000 |   1.020000 |
- |    6 | Model_6  | Color_6  |    0 | 1609876342571 |              256 |         2021 |  755.989990 |       665.489990 | [5,15,25]     | [15,100,500]  | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.200000,0.400000,-0.600000,0.800000 |   1.100000 |
- |   10 | Model_10 | Color_10 |    0 | 1678956543120 |              512 |         2022 | 1299.989990 |      1099.989990 | [9,8,7]       | [555,444,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.900000,0.100000,0.800000,-0.200000  |   1.260000 |
- |    8 | Model_8  | Color_8  |    0 | 1654876543130 |              256 |         2019 |  800.989990 |       699.989990 | [22,33,44]    | [66,333,999]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.800000,0.600000,0.200000,-0.400000  |   1.300000 |
- |    4 | Model_4  | Color_4  |    0 | 1615319697581 |              128 |         2020 |  424.230011 |       883.900024 | [98,96,89]    | [166,252,510] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.700000,-0.800000,0.100000,-0.200000 | 1.75999987 |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |       10 |
- +----------+
test/clt-tests/core/tets-insert-knn-errors.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test2 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test2 (id, model, vector) VALUES (1, 'Model_1', (0.286569,-0.031816,0.066684,0.032926))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test2 WHERE knn(vector, 10, 1)"
––– output –––
- ERROR 1064 (42000) at line 1: table knn_test2: KNN index not enabled for attribute 'vector'
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test2"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test3 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test3 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test3 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test3"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test4 (id BIGINT, model TEXT, vector int)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test4 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test4 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test4"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test5 (id BIGINT, model TEXT, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test5 (id, model, vector) VALUES (1, 'Model_1', (0.9012, 0.2126, 0.2879, 0.7552))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test5 WHERE knn(vector, 10, 1)"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |        1 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test5"
––– output –––
OK

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/plugins/
✅ OK: 0
❌ Failed: 1
⏳ Duration: 12s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/plugins/test-enable-disable-buddy-plugin.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "create table t (id bigint, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
- ERROR 1064 (42000) at line 1: Plugin 'knn' is disabled
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/core/ test/clt-tests/expected-errors/
✅ OK: 47
❌ Failed: 2
⏳ Duration: 449s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/core/test-knn-id.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd $SEARCHD_FLAGS > /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 –––
OK
––– input –––
mysql -h0 -P9306 -e "create table test ( title text, image_vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2' );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "insert into test values ( 1, 'yellow bag', (0.653448,0.192478,0.017971,0.339821) ), ( 2, 'white bag', (-0.148894,0.748278,0.091892,-0.095406) );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, (0.286569,-0.031816,0.066684,0.032926), {ef=2000} );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | knn_dist() |
- +------+------------+
- |    2 | 1.14755321 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | title     | image_vector                          | @knn_dist  |
- +------+-----------+---------------------------------------+------------+
- |    2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
- +------+-----------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "select count(*) from test where knn ( image_vector, 5, 1 );"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | count(*) |
- +----------+
- |        2 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, color TEXT, sold BOOL, date_added BIGINT, storage_capacity UINT, release_year UINT, price FLOAT, discounted_price FLOAT, product_codes JSON, values JSON, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, color, sold, date_added, storage_capacity, release_year, price, discounted_price, product_codes, values, additional_info, vector) VALUES (1, 'Model_1', 'Color_1', 1, 1620590570251, 512, 2022, 654.19, 855.34, '[81,56,60]', '[96,389,27]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.1, 0.2, 0.3, 0.4)), (2, 'Model_2', 'Color_2', 1, 1689374130160, 128, 2020, 663.70, 767.99, '[12,39,30]', '[226,305,123]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.286569, -0.031816, 0.066684, 0.032926)), (3, 'Model_3', 'Color_3', 0, 1640782021529, 512, 2020, 676.46, 847.08, '[62,13,4]', '[707,601,608]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.5, 0.7, -0.1, 0.2)), (4, 'Model_4', 'Color_4', 0, 1615319697581, 128, 2020, 424.23, 883.90, '[98,96,89]', '[166,252,510]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.7, -0.8, 0.1, -0.2)), (5, 'Model_5', 'Color_5', 1, 1671157942660, 128, 2021, 1173.29, 977.33, '[27,12,37]', '[988,87,21]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.3, 0.4, 0.5, 0.6)), (6, 'Model_6', 'Color_6', 0, 1609876342571, 256, 2021, 755.99, 665.49, '[5,15,25]', '[15,100,500]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.2, 0.4, -0.6, 0.8)), (7, 'Model_7', 'Color_7', 1, 1648765432160, 64, 2019, 299.99, 199.99, '[77,88,99]', '[99,888,555]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.5, -0.3, 0.9, -0.1)), (8, 'Model_8', 'Color_8', 0, 1654876543130, 256, 2019, 800.99, 699.99, '[22,33,44]', '[66,333,999]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.8, 0.6, 0.2, -0.4)), (9, 'Model_9', 'Color_9', 1, 1631567882541, 128, 2022, 499.99, 399.99, '[11,22,33]', '[111,222,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.1, 0.3, -0.5, 0.7)), (10, 'Model_10', 'Color_10', 0, 1678956543120, 512, 2022, 1299.99, 1099.99, '[9,8,7]', '[555,444,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.9, 0.1, 0.8, -0.2));"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | model    | color    | sold | date_added    | storage_capacity | release_year | price       | discounted_price | product_codes | values        | additional_info                                    | vector                                | @knn_dist  |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
- |    5 | Model_5  | Color_5  |    1 | 1671157942660 |              128 |         2021 | 1173.290039 |       977.330017 | [27,12,37]    | [988,87,21]   | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.300000,0.400000,0.500000,0.600000   | 0.16000001 |
- |    2 | Model_2  | Color_2  |    1 | 1689374130160 |              128 |         2020 |  663.700012 |       767.989990 | [12,39,30]    | [226,305,123] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.286569,-0.031816,0.066684,0.032926  | 0.27772635 |
- |    9 | Model_9  | Color_9  |    1 | 1631567882541 |              128 |         2022 |  499.989990 |       399.989990 | [11,22,33]    | [111,222,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.100000,0.300000,-0.500000,0.700000 | 0.78000003 |
- |    3 | Model_3  | Color_3  |    0 | 1640782021529 |              512 |         2020 |  676.460022 |       847.080017 | [62,13,4]     | [707,601,608] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.500000,0.700000,-0.100000,0.200000 | 0.81000006 |
- |    7 | Model_7  | Color_7  |    1 | 1648765432160 |               64 |         2019 |  299.989990 |       199.990005 | [77,88,99]    | [99,888,555]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.500000,-0.300000,0.900000,-0.100000 |   1.020000 |
- |    6 | Model_6  | Color_6  |    0 | 1609876342571 |              256 |         2021 |  755.989990 |       665.489990 | [5,15,25]     | [15,100,500]  | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.200000,0.400000,-0.600000,0.800000 |   1.100000 |
- |   10 | Model_10 | Color_10 |    0 | 1678956543120 |              512 |         2022 | 1299.989990 |      1099.989990 | [9,8,7]       | [555,444,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.900000,0.100000,0.800000,-0.200000  |   1.260000 |
- |    8 | Model_8  | Color_8  |    0 | 1654876543130 |              256 |         2019 |  800.989990 |       699.989990 | [22,33,44]    | [66,333,999]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.800000,0.600000,0.200000,-0.400000  |   1.300000 |
- |    4 | Model_4  | Color_4  |    0 | 1615319697581 |              128 |         2020 |  424.230011 |       883.900024 | [98,96,89]    | [166,252,510] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.700000,-0.800000,0.100000,-0.200000 | 1.75999987 |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |       10 |
- +----------+
test/clt-tests/core/tets-insert-knn-errors.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test2 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test2 (id, model, vector) VALUES (1, 'Model_1', (0.286569,-0.031816,0.066684,0.032926))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test2 WHERE knn(vector, 10, 1)"
––– output –––
- ERROR 1064 (42000) at line 1: table knn_test2: KNN index not enabled for attribute 'vector'
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test2"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test3 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test3 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test3 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test3"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test4 (id BIGINT, model TEXT, vector int)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test4 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test4 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test4"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test5 (id BIGINT, model TEXT, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test5 (id, model, vector) VALUES (1, 'Model_1', (0.9012, 0.2126, 0.2879, 0.7552))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test5 WHERE knn(vector, 10, 1)"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |        1 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test5"
––– output –––
OK

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/plugins/
✅ OK: 0
❌ Failed: 1
⏳ Duration: 11s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/plugins/test-enable-disable-buddy-plugin.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "create table t (id bigint, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
- ERROR 1064 (42000) at line 1: Plugin 'knn' is disabled
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/core/ test/clt-tests/expected-errors/
✅ OK: 47
❌ Failed: 2
⏳ Duration: 448s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/core/test-knn-id.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd $SEARCHD_FLAGS > /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 –––
OK
––– input –––
mysql -h0 -P9306 -e "create table test ( title text, image_vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2' );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "insert into test values ( 1, 'yellow bag', (0.653448,0.192478,0.017971,0.339821) ), ( 2, 'white bag', (-0.148894,0.748278,0.091892,-0.095406) );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, (0.286569,-0.031816,0.066684,0.032926), {ef=2000} );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | knn_dist() |
- +------+------------+
- |    2 | 1.14755321 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | title     | image_vector                          | @knn_dist  |
- +------+-----------+---------------------------------------+------------+
- |    2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
- +------+-----------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "select count(*) from test where knn ( image_vector, 5, 1 );"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | count(*) |
- +----------+
- |        2 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, color TEXT, sold BOOL, date_added BIGINT, storage_capacity UINT, release_year UINT, price FLOAT, discounted_price FLOAT, product_codes JSON, values JSON, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, color, sold, date_added, storage_capacity, release_year, price, discounted_price, product_codes, values, additional_info, vector) VALUES (1, 'Model_1', 'Color_1', 1, 1620590570251, 512, 2022, 654.19, 855.34, '[81,56,60]', '[96,389,27]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.1, 0.2, 0.3, 0.4)), (2, 'Model_2', 'Color_2', 1, 1689374130160, 128, 2020, 663.70, 767.99, '[12,39,30]', '[226,305,123]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.286569, -0.031816, 0.066684, 0.032926)), (3, 'Model_3', 'Color_3', 0, 1640782021529, 512, 2020, 676.46, 847.08, '[62,13,4]', '[707,601,608]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.5, 0.7, -0.1, 0.2)), (4, 'Model_4', 'Color_4', 0, 1615319697581, 128, 2020, 424.23, 883.90, '[98,96,89]', '[166,252,510]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.7, -0.8, 0.1, -0.2)), (5, 'Model_5', 'Color_5', 1, 1671157942660, 128, 2021, 1173.29, 977.33, '[27,12,37]', '[988,87,21]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.3, 0.4, 0.5, 0.6)), (6, 'Model_6', 'Color_6', 0, 1609876342571, 256, 2021, 755.99, 665.49, '[5,15,25]', '[15,100,500]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.2, 0.4, -0.6, 0.8)), (7, 'Model_7', 'Color_7', 1, 1648765432160, 64, 2019, 299.99, 199.99, '[77,88,99]', '[99,888,555]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.5, -0.3, 0.9, -0.1)), (8, 'Model_8', 'Color_8', 0, 1654876543130, 256, 2019, 800.99, 699.99, '[22,33,44]', '[66,333,999]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.8, 0.6, 0.2, -0.4)), (9, 'Model_9', 'Color_9', 1, 1631567882541, 128, 2022, 499.99, 399.99, '[11,22,33]', '[111,222,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.1, 0.3, -0.5, 0.7)), (10, 'Model_10', 'Color_10', 0, 1678956543120, 512, 2022, 1299.99, 1099.99, '[9,8,7]', '[555,444,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.9, 0.1, 0.8, -0.2));"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | model    | color    | sold | date_added    | storage_capacity | release_year | price       | discounted_price | product_codes | values        | additional_info                                    | vector                                | @knn_dist  |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
- |    5 | Model_5  | Color_5  |    1 | 1671157942660 |              128 |         2021 | 1173.290039 |       977.330017 | [27,12,37]    | [988,87,21]   | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.300000,0.400000,0.500000,0.600000   | 0.16000001 |
- |    2 | Model_2  | Color_2  |    1 | 1689374130160 |              128 |         2020 |  663.700012 |       767.989990 | [12,39,30]    | [226,305,123] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.286569,-0.031816,0.066684,0.032926  | 0.27772635 |
- |    9 | Model_9  | Color_9  |    1 | 1631567882541 |              128 |         2022 |  499.989990 |       399.989990 | [11,22,33]    | [111,222,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.100000,0.300000,-0.500000,0.700000 | 0.78000003 |
- |    3 | Model_3  | Color_3  |    0 | 1640782021529 |              512 |         2020 |  676.460022 |       847.080017 | [62,13,4]     | [707,601,608] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.500000,0.700000,-0.100000,0.200000 | 0.81000006 |
- |    7 | Model_7  | Color_7  |    1 | 1648765432160 |               64 |         2019 |  299.989990 |       199.990005 | [77,88,99]    | [99,888,555]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.500000,-0.300000,0.900000,-0.100000 |   1.020000 |
- |    6 | Model_6  | Color_6  |    0 | 1609876342571 |              256 |         2021 |  755.989990 |       665.489990 | [5,15,25]     | [15,100,500]  | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.200000,0.400000,-0.600000,0.800000 |   1.100000 |
- |   10 | Model_10 | Color_10 |    0 | 1678956543120 |              512 |         2022 | 1299.989990 |      1099.989990 | [9,8,7]       | [555,444,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.900000,0.100000,0.800000,-0.200000  |   1.260000 |
- |    8 | Model_8  | Color_8  |    0 | 1654876543130 |              256 |         2019 |  800.989990 |       699.989990 | [22,33,44]    | [66,333,999]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.800000,0.600000,0.200000,-0.400000  |   1.300000 |
- |    4 | Model_4  | Color_4  |    0 | 1615319697581 |              128 |         2020 |  424.230011 |       883.900024 | [98,96,89]    | [166,252,510] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.700000,-0.800000,0.100000,-0.200000 | 1.75999987 |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |       10 |
- +----------+
test/clt-tests/core/tets-insert-knn-errors.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test2 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test2 (id, model, vector) VALUES (1, 'Model_1', (0.286569,-0.031816,0.066684,0.032926))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test2 WHERE knn(vector, 10, 1)"
––– output –––
- ERROR 1064 (42000) at line 1: table knn_test2: KNN index not enabled for attribute 'vector'
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test2"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test3 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test3 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test3 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test3"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test4 (id BIGINT, model TEXT, vector int)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test4 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test4 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test4"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test5 (id BIGINT, model TEXT, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test5 (id, model, vector) VALUES (1, 'Model_1', (0.9012, 0.2126, 0.2879, 0.7552))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test5 WHERE knn(vector, 10, 1)"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |        1 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test5"
––– output –––
OK

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/core/ test/clt-tests/expected-errors/
✅ OK: 47
❌ Failed: 2
⏳ Duration: 450s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/core/test-knn-id.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd $SEARCHD_FLAGS > /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 –––
OK
––– input –––
mysql -h0 -P9306 -e "create table test ( title text, image_vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2' );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "insert into test values ( 1, 'yellow bag', (0.653448,0.192478,0.017971,0.339821) ), ( 2, 'white bag', (-0.148894,0.748278,0.091892,-0.095406) );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, (0.286569,-0.031816,0.066684,0.032926), {ef=2000} );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | knn_dist() |
- +------+------------+
- |    2 | 1.14755321 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | title     | image_vector                          | @knn_dist  |
- +------+-----------+---------------------------------------+------------+
- |    2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
- +------+-----------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "select count(*) from test where knn ( image_vector, 5, 1 );"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | count(*) |
- +----------+
- |        2 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, color TEXT, sold BOOL, date_added BIGINT, storage_capacity UINT, release_year UINT, price FLOAT, discounted_price FLOAT, product_codes JSON, values JSON, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, color, sold, date_added, storage_capacity, release_year, price, discounted_price, product_codes, values, additional_info, vector) VALUES (1, 'Model_1', 'Color_1', 1, 1620590570251, 512, 2022, 654.19, 855.34, '[81,56,60]', '[96,389,27]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.1, 0.2, 0.3, 0.4)), (2, 'Model_2', 'Color_2', 1, 1689374130160, 128, 2020, 663.70, 767.99, '[12,39,30]', '[226,305,123]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.286569, -0.031816, 0.066684, 0.032926)), (3, 'Model_3', 'Color_3', 0, 1640782021529, 512, 2020, 676.46, 847.08, '[62,13,4]', '[707,601,608]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.5, 0.7, -0.1, 0.2)), (4, 'Model_4', 'Color_4', 0, 1615319697581, 128, 2020, 424.23, 883.90, '[98,96,89]', '[166,252,510]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.7, -0.8, 0.1, -0.2)), (5, 'Model_5', 'Color_5', 1, 1671157942660, 128, 2021, 1173.29, 977.33, '[27,12,37]', '[988,87,21]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.3, 0.4, 0.5, 0.6)), (6, 'Model_6', 'Color_6', 0, 1609876342571, 256, 2021, 755.99, 665.49, '[5,15,25]', '[15,100,500]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.2, 0.4, -0.6, 0.8)), (7, 'Model_7', 'Color_7', 1, 1648765432160, 64, 2019, 299.99, 199.99, '[77,88,99]', '[99,888,555]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.5, -0.3, 0.9, -0.1)), (8, 'Model_8', 'Color_8', 0, 1654876543130, 256, 2019, 800.99, 699.99, '[22,33,44]', '[66,333,999]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.8, 0.6, 0.2, -0.4)), (9, 'Model_9', 'Color_9', 1, 1631567882541, 128, 2022, 499.99, 399.99, '[11,22,33]', '[111,222,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.1, 0.3, -0.5, 0.7)), (10, 'Model_10', 'Color_10', 0, 1678956543120, 512, 2022, 1299.99, 1099.99, '[9,8,7]', '[555,444,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.9, 0.1, 0.8, -0.2));"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | model    | color    | sold | date_added    | storage_capacity | release_year | price       | discounted_price | product_codes | values        | additional_info                                    | vector                                | @knn_dist  |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
- |    5 | Model_5  | Color_5  |    1 | 1671157942660 |              128 |         2021 | 1173.290039 |       977.330017 | [27,12,37]    | [988,87,21]   | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.300000,0.400000,0.500000,0.600000   | 0.16000001 |
- |    2 | Model_2  | Color_2  |    1 | 1689374130160 |              128 |         2020 |  663.700012 |       767.989990 | [12,39,30]    | [226,305,123] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.286569,-0.031816,0.066684,0.032926  | 0.27772635 |
- |    9 | Model_9  | Color_9  |    1 | 1631567882541 |              128 |         2022 |  499.989990 |       399.989990 | [11,22,33]    | [111,222,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.100000,0.300000,-0.500000,0.700000 | 0.78000003 |
- |    3 | Model_3  | Color_3  |    0 | 1640782021529 |              512 |         2020 |  676.460022 |       847.080017 | [62,13,4]     | [707,601,608] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.500000,0.700000,-0.100000,0.200000 | 0.81000006 |
- |    7 | Model_7  | Color_7  |    1 | 1648765432160 |               64 |         2019 |  299.989990 |       199.990005 | [77,88,99]    | [99,888,555]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.500000,-0.300000,0.900000,-0.100000 |   1.020000 |
- |    6 | Model_6  | Color_6  |    0 | 1609876342571 |              256 |         2021 |  755.989990 |       665.489990 | [5,15,25]     | [15,100,500]  | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.200000,0.400000,-0.600000,0.800000 |   1.100000 |
- |   10 | Model_10 | Color_10 |    0 | 1678956543120 |              512 |         2022 | 1299.989990 |      1099.989990 | [9,8,7]       | [555,444,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.900000,0.100000,0.800000,-0.200000  |   1.260000 |
- |    8 | Model_8  | Color_8  |    0 | 1654876543130 |              256 |         2019 |  800.989990 |       699.989990 | [22,33,44]    | [66,333,999]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.800000,0.600000,0.200000,-0.400000  |   1.300000 |
- |    4 | Model_4  | Color_4  |    0 | 1615319697581 |              128 |         2020 |  424.230011 |       883.900024 | [98,96,89]    | [166,252,510] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.700000,-0.800000,0.100000,-0.200000 | 1.75999987 |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |       10 |
- +----------+
test/clt-tests/core/tets-insert-knn-errors.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test2 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test2 (id, model, vector) VALUES (1, 'Model_1', (0.286569,-0.031816,0.066684,0.032926))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test2 WHERE knn(vector, 10, 1)"
––– output –––
- ERROR 1064 (42000) at line 1: table knn_test2: KNN index not enabled for attribute 'vector'
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test2"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test3 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test3 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test3 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test3"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test4 (id BIGINT, model TEXT, vector int)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test4 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test4 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test4"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test5 (id BIGINT, model TEXT, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test5 (id, model, vector) VALUES (1, 'Model_1', (0.9012, 0.2126, 0.2879, 0.7552))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test5 WHERE knn(vector, 10, 1)"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |        1 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test5"
––– output –––
OK

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/plugins/
✅ OK: 0
❌ Failed: 1
⏳ Duration: 11s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/plugins/test-enable-disable-buddy-plugin.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-show"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SHOW QUERIES\G"|grep "1. row"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "create table t (id bigint, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "DISABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
- ERROR 1064 (42000) at line 1: Plugin 'knn' is disabled
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
––– input –––
mysql -h0 -P9306 -e "ENABLE BUDDY PLUGIN manticoresoftware/buddy-plugin-knn"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from t where knn ( image_vector, 5, 1 );"
––– output –––
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'

@github-actions

Copy link
Copy Markdown
Contributor

clt

❌ CLT tests in test/clt-tests/core/ test/clt-tests/expected-errors/
✅ OK: 47
❌ Failed: 2
⏳ Duration: 457s
👉 Check Action Results for commit 93dee4b
Failed tests:

test/clt-tests/core/test-knn-id.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd $SEARCHD_FLAGS > /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 –––
OK
––– input –––
mysql -h0 -P9306 -e "create table test ( title text, image_vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2' );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "insert into test values ( 1, 'yellow bag', (0.653448,0.192478,0.017971,0.339821) ), ( 2, 'white bag', (-0.148894,0.748278,0.091892,-0.095406) );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, (0.286569,-0.031816,0.066684,0.032926), {ef=2000} );"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "select id, knn_dist() from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | knn_dist() |
- +------+------------+
- |    2 | 1.14755321 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "select * from test where knn ( image_vector, 5, 1 );"
––– output –––
- +------+-----------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | id   | title     | image_vector                          | @knn_dist  |
- +------+-----------+---------------------------------------+------------+
- |    2 | white bag | -0.148894,0.748278,0.091892,-0.095406 | 1.14755321 |
- +------+-----------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "select count(*) from test where knn ( image_vector, 5, 1 );"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1 )'
- | count(*) |
- +----------+
- |        2 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, color TEXT, sold BOOL, date_added BIGINT, storage_capacity UINT, release_year UINT, price FLOAT, discounted_price FLOAT, product_codes JSON, values JSON, additional_info JSON, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2');"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, color, sold, date_added, storage_capacity, release_year, price, discounted_price, product_codes, values, additional_info, vector) VALUES (1, 'Model_1', 'Color_1', 1, 1620590570251, 512, 2022, 654.19, 855.34, '[81,56,60]', '[96,389,27]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.1, 0.2, 0.3, 0.4)), (2, 'Model_2', 'Color_2', 1, 1689374130160, 128, 2020, 663.70, 767.99, '[12,39,30]', '[226,305,123]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.286569, -0.031816, 0.066684, 0.032926)), (3, 'Model_3', 'Color_3', 0, 1640782021529, 512, 2020, 676.46, 847.08, '[62,13,4]', '[707,601,608]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.5, 0.7, -0.1, 0.2)), (4, 'Model_4', 'Color_4', 0, 1615319697581, 128, 2020, 424.23, 883.90, '[98,96,89]', '[166,252,510]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.7, -0.8, 0.1, -0.2)), (5, 'Model_5', 'Color_5', 1, 1671157942660, 128, 2021, 1173.29, 977.33, '[27,12,37]', '[988,87,21]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.3, 0.4, 0.5, 0.6)), (6, 'Model_6', 'Color_6', 0, 1609876342571, 256, 2021, 755.99, 665.49, '[5,15,25]', '[15,100,500]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.2, 0.4, -0.6, 0.8)), (7, 'Model_7', 'Color_7', 1, 1648765432160, 64, 2019, 299.99, 199.99, '[77,88,99]', '[99,888,555]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.5, -0.3, 0.9, -0.1)), (8, 'Model_8', 'Color_8', 0, 1654876543130, 256, 2019, 800.99, 699.99, '[22,33,44]', '[66,333,999]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.8, 0.6, 0.2, -0.4)), (9, 'Model_9', 'Color_9', 1, 1631567882541, 128, 2022, 499.99, 399.99, '[11,22,33]', '[111,222,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (-0.1, 0.3, -0.5, 0.7)), (10, 'Model_10', 'Color_10', 0, 1678956543120, 512, 2022, 1299.99, 1099.99, '[9,8,7]', '[555,444,333]', '{\"features\": [\"Feature_1\", \"Feature_2\", \"Feature_3\"]}', (0.9, 0.1, 0.8, -0.2));"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT id, knn_dist() FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | knn_dist() |
- +------+------------+
- |    5 | 0.16000001 |
- |    2 | 0.27772635 |
- |    9 | 0.78000003 |
- |    3 | 0.81000006 |
- |    7 |   1.020000 |
- |    6 |   1.100000 |
- |   10 |   1.260000 |
- |    8 |   1.300000 |
- |    4 | 1.75999987 |
- +------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT * FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | id   | model    | color    | sold | date_added    | storage_capacity | release_year | price       | discounted_price | product_codes | values        | additional_info                                    | vector                                | @knn_dist  |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
- |    5 | Model_5  | Color_5  |    1 | 1671157942660 |              128 |         2021 | 1173.290039 |       977.330017 | [27,12,37]    | [988,87,21]   | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.300000,0.400000,0.500000,0.600000   | 0.16000001 |
- |    2 | Model_2  | Color_2  |    1 | 1689374130160 |              128 |         2020 |  663.700012 |       767.989990 | [12,39,30]    | [226,305,123] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.286569,-0.031816,0.066684,0.032926  | 0.27772635 |
- |    9 | Model_9  | Color_9  |    1 | 1631567882541 |              128 |         2022 |  499.989990 |       399.989990 | [11,22,33]    | [111,222,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.100000,0.300000,-0.500000,0.700000 | 0.78000003 |
- |    3 | Model_3  | Color_3  |    0 | 1640782021529 |              512 |         2020 |  676.460022 |       847.080017 | [62,13,4]     | [707,601,608] | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.500000,0.700000,-0.100000,0.200000 | 0.81000006 |
- |    7 | Model_7  | Color_7  |    1 | 1648765432160 |               64 |         2019 |  299.989990 |       199.990005 | [77,88,99]    | [99,888,555]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.500000,-0.300000,0.900000,-0.100000 |   1.020000 |
- |    6 | Model_6  | Color_6  |    0 | 1609876342571 |              256 |         2021 |  755.989990 |       665.489990 | [5,15,25]     | [15,100,500]  | {"features":["Feature_1","Feature_2","Feature_3"]} | -0.200000,0.400000,-0.600000,0.800000 |   1.100000 |
- |   10 | Model_10 | Color_10 |    0 | 1678956543120 |              512 |         2022 | 1299.989990 |      1099.989990 | [9,8,7]       | [555,444,333] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.900000,0.100000,0.800000,-0.200000  |   1.260000 |
- |    8 | Model_8  | Color_8  |    0 | 1654876543130 |              256 |         2019 |  800.989990 |       699.989990 | [22,33,44]    | [66,333,999]  | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.800000,0.600000,0.200000,-0.400000  |   1.300000 |
- |    4 | Model_4  | Color_4  |    0 | 1615319697581 |              128 |         2020 |  424.230011 |       883.900024 | [98,96,89]    | [166,252,510] | {"features":["Feature_1","Feature_2","Feature_3"]} | 0.700000,-0.800000,0.100000,-0.200000 | 1.75999987 |
- +------+----------+----------+------+---------------+------------------+--------------+-------------+------------------+---------------+---------------+----------------------------------------------------+---------------------------------------+------------+
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 5, 1);"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |       10 |
- +----------+
test/clt-tests/core/tets-insert-knn-errors.rec
––– input –––
rm -f /var/log/manticore/searchd.log; stdbuf -oL searchd --stopwait > /dev/null; stdbuf -oL searchd ${SEARCHD_ARGS:-} > /dev/null
––– output –––
OK
––– 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 –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test2 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test2 (id, model, vector) VALUES (1, 'Model_1', (0.286569,-0.031816,0.066684,0.032926))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test2 WHERE knn(vector, 10, 1)"
––– output –––
- ERROR 1064 (42000) at line 1: table knn_test2: KNN index not enabled for attribute 'vector'
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test2"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test3 (id BIGINT, model TEXT, vector float_vector)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test3 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test3 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test3"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test4 (id BIGINT, model TEXT, vector int)"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test4 (id, model, vector) VALUES (1, 'Model_1', '[0.9012, 0.2126, 0.2879, 0.7552]')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test4 WHERE knn(vector, 10, 1)"; echo $?
––– output –––
- 0
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
+ 1
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test4"
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "CREATE TABLE knn_test5 (id BIGINT, model TEXT, vector float_vector knn_type='hnsw' knn_dims='4' hnsw_similarity='l2')"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "INSERT INTO knn_test5 (id, model, vector) VALUES (1, 'Model_1', (0.9012, 0.2126, 0.2879, 0.7552))"; echo $?
––– output –––
OK
––– input –––
mysql -h0 -P9306 -e "SELECT count(*) FROM knn_test5 WHERE knn(vector, 10, 1)"
––– output –––
- +----------+
+ ERROR 1064 (42000) at line 1: P01: syntax error, unexpected integer, expecting string or '(' near '1)'
- | count(*) |
- +----------+
- |        1 |
- +----------+
––– input –––
mysql -h0 -P9306 -e "SHOW CREATE TABLE knn_test5"
––– output –––
OK

@sanikolaev sanikolaev force-pushed the embeddings_in_queries branch from 1595983 to 59c4138 Compare July 25, 2025 08:16
@glookka glookka merged commit 8fbb8e6 into master Jul 25, 2025
52 checks passed
@glookka glookka deleted the embeddings_in_queries branch July 25, 2025 09:08
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.

1 participant