ALTER RENAME - ошибка P03 syntax error

Доброго времени суток.
Имеется: Ubuntu 22.04.3 LTS, Manticore 6.3.6, установленные пакеты:

manticore-backup/jammy,now 1.3.8-24052208-57fc406 all [установлен]
manticore-buddy/jammy,now 2.3.12-24071807-45f6b91 all [установлен]
manticore-columnar-lib/jammy,now 2.3.0-24052206-88a01c3 amd64 [установлен]
manticore-common/jammy,now 6.3.6-24080214-593045790 all [установлен, автоматически]
manticore-dev/jammy,now 6.3.6-24080214-593045790 all [установлен]
manticore-executor/jammy,now 1.1.12-24071807-0565a65 amd64 [установлен]
manticore-galera/jammy,now 3.37 amd64 [установлен]
manticore-icudata-65l/jammy,now 5.0.3-221123-d2d9e5e56 all [установлен]
manticore-server-core/jammy,now 6.3.6-24080214-593045790 amd64 [установлен]
manticore-server/jammy,now 6.3.6-24080214-593045790 amd64 [установлен]
manticore-tools/jammy,now 6.3.6-24080214-593045790 amd64 [установлен]
manticore-tzdata/jammy,now 1.0.0-240522-a8aa66e all [установлен, автоматически]
manticore/jammy,now 6.3.6-24080214-593045790 amd64 [установлен]

Запущенные процессы:

mantico+ 1937419  0.0  0.0  55984  3808 ?        S    12:58   0:00 /usr/bin/searchd --config /etc/manticoresearch/manticore.conf
mantico+ 1937420  9.2 53.2 5152152 4324592 ?     Sl   12:58   4:08 /usr/bin/searchd --config /etc/manticoresearch/manticore.conf
mantico+ 1937431  0.0  0.2  63056 16396 ?        S    12:58   0:00 manticoresearch-buddy-manager
mantico+ 1937442  0.0  0.1  67220 13360 ?        S    12:58   0:00 manticoresearch-buddy-worker [0]
mantico+ 1937443  0.0  0.1  69336 11924 ?        S    12:58   0:00 manticoresearch-buddy-base-lib-metricthread

Статус сервиса:

● manticore.service - Manticore Search Engine
     Loaded: loaded (/lib/systemd/system/manticore.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2024-11-05 12:58:06 UTC; 45min ago
       Docs: https://manual.manticoresearch.com/,
             man:searchd(1)
    Process: 1937417 ExecStart=/usr/bin/searchd --config /etc/manticoresearch/manticore.conf $_ADDITIONAL_SEARCHD_PARAMS (code=exited, status=0/SUCCESS)
   Main PID: 1937420 (searchd)
      Tasks: 14 (limit: 9386)
     Memory: 6.6G
        CPU: 4min 8.761s
     CGroup: /system.slice/manticore.service
             ├─1937419 /usr/bin/searchd --config /etc/manticoresearch/manticore.conf
             ├─1937420 /usr/bin/searchd --config /etc/manticoresearch/manticore.conf
             ├─1937431 manticoresearch-buddy-manager "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "">
             ├─1937442 "manticoresearch-buddy-worker [0]" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" >
             └─1937443 manticoresearch-buddy-base-lib-metricthread "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" >

ноя 05 12:58:05 manticore-msearch-stage searchd[1937420]: WARNING: table '/var/lib/manticore/products_for_suggest_new/products_for_suggest_new.39': wordforms file '/var/lib/manticore/product>
ноя 05 12:58:05 manticore-msearch-stage searchd[1937420]: WARNING: table '/var/lib/manticore/products_for_suggest_new/products_for_suggest_new.39': wordforms file '/var/lib/manticore/product>
ноя 05 12:58:05 manticore-msearch-stage searchd[1937420]: WARNING: table 'products_for_suggest_new': table 'products_for_suggest_new': morphology option changed from config has no effect, ig>
ноя 05 12:58:05 manticore-msearch-stage searchd[1937420]: precaching table 'demo'
ноя 05 12:58:06 manticore-msearch-stage searchd[1937417]: Manticore 6.3.6 593045790@24080214 (columnar 2.3.0 88a01c3@24052206) (secondary 2.3.0 88a01c3@24052206) (knn 2.3.0 88a01c3@24052206)
ноя 05 12:58:06 manticore-msearch-stage searchd[1937417]: Copyright (c) 2001-2016, Andrew Aksyonoff
ноя 05 12:58:06 manticore-msearch-stage searchd[1937417]: Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
ноя 05 12:58:06 manticore-msearch-stage searchd[1937417]: Copyright (c) 2017-2024, Manticore Software LTD (https://manticoresearch.com)
ноя 05 12:58:06 manticore-msearch-stage systemd[1]: manticore.service: Supervising process 1937420 which is not our child. We'll most likely not notice when it exits.
ноя 05 12:58:06 manticore-msearch-stage systemd[1]: Started Manticore Search Engine.

Индексы rt:

mysql> show tables;
+---------------------------+------+
| Index                     | Type |
+---------------------------+------+
| articles                  | rt   |
| authors                   | rt   |
| bindings                  | rt   |
| book_cycles               | rt   |
| categories                | rt   |
| product_collections       | rt   |
| product_properties_values | rt   |
| products                  | rt   |
| products_for_suggest      | rt   |
| products_for_suggest_new  | rt   |
| products_new              | rt   |
| products_word             | rt   |
| publisher_brands          | rt   |
| publishers                | rt   |
| search_phrase             | rt   |
| search_result_rule        | rt   |
| series                    | rt   |
| shops                     | rt   |
| tbks                      | rt   |
| umk                       | rt   |
+---------------------------+------+
20 rows in set (0,00 sec)

Были созданы 2 индекса их схемы - sql-файла:
products
products_for_suggest_new

Нужно переименовать:
products в products_old
products_for_suggest в products_for_suggest_old

Зачистить каталог с индексами:
/var/lib/manticore/products
/var/lib/manticore/products_for_suggest
Кстати, почему при RENAME и даже при DROP TABLE все еще остается каталог? Это мешает выполнить переименование, т.к. возникает ошибка пока не зачистить его.

Затем переименовать:
products_new в products
products_for_suggest_new в products_for_suggest

Но при попытке переименовать - ошибка:

mysql> alter table products raname products_old;
ERROR 1064 (42000): P03: syntax error, unexpected tablename, expecting '=' near 'products_old'
mysql> alter table products_for_suggest raname products_for_suggest_old;
ERROR 1064 (42000): P03: syntax error, unexpected tablename, expecting '=' near 'products_for_suggest_old'

Причем даже если создать пустой индекс с одним полем - такая же ошибка будет при попытке переименовать.

Из лога после перезапуска Manticore (на всякий случай):

[Tue Nov  5 12:58:05.959 2024] [1937422] prereading 21 tables
[Tue Nov  5 12:58:06.014 2024] [1937420] accepting connections
[Tue Nov  5 12:58:06.227 2024] [1937423] [BUDDY] started v2.3.12 '/usr/share/manticore/modules/manticore-buddy/bin/manticore-buddy --li
sten=http://10.9.2.78:9312 --bind=127.0.0.1 --disable-telemetry --threads=7 --skip=manticoresoftware/buddy-plugin-sharding --skip=manti
coresoftware/buddy-plugin-queue' at http://127.0.0.1:33199
[Tue Nov  5 12:58:06.227 2024] [1937423] [BUDDY] Loaded plugins:
[Tue Nov  5 12:58:06.227 2024] [1937423] [BUDDY]   core: empty-string, backup, emulate-elastic, create, insert, alias, select, show, cl
i-table, plugin, test, alter-distributed-table, alter-rename-table, modify-table, knn, replace
[Tue Nov  5 12:58:06.227 2024] [1937423] [BUDDY]   local: 
[Tue Nov  5 12:58:06.227 2024] [1937423] [BUDDY]   extra: 
[Tue Nov  5 12:58:11.179 2024] [1937422] preread 21 tables in 5.220 sec

Видел такую же проблему - ALTER RENAME выдает ошибку P03 syntax error, но что-то не без решения.

Что ему не так?

вам нужно писать

alter table products RENAME products_old;

как написано в документации Manticore Search Manual: Updating table schema and settings

1 Like

Интересно, что на той же версии с тем же развертыванием, но на другом сервере с нижнем регистре работало.

Сейчас проверил на проблемном:

mysql> create table demo (info text);
Query OK, 0 rows affected (0,01 sec)

mysql> ALTER TABLE demo RENAME demo_old;
Query OK, 0 rows affected (0,19 sec)

Все ок.

Дело не в регистре. У вас опечатка - “raname” через “a” вместо “e”.

1 Like

Да как так( Спасибо, не заметил.