Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

mariadb can't create table FEDERATED #789

Closed
rounce opened this issue May 24, 2022 · 3 comments
Closed

mariadb can't create table FEDERATED #789

rounce opened this issue May 24, 2022 · 3 comments
Labels

Comments

@rounce
Copy link

rounce commented May 24, 2022

Describe the bug
Can't create FEDERATED table in mariadb as in the documentation https://manual.manticoresearch.com/Extensions/FEDERATED
To Reproduce
Steps to reproduce the behavior:
1.

CREATE TABLE t1  
(  
    id          INTEGER UNSIGNED NOT NULL,  
    query       VARCHAR(1024) NOT NULL,  
    INDEX(query)  
) ENGINE=FEDERATED  
DEFAULT CHARSET=utf8  
CONNECTION='mysql://FEDERATED@127.0.0.1:9306/DB/test';  

mariadb says: #1434 - Can't create federated table.
manticore says: Unknown session variable 'time_zone' in SET statement

Describe the environment:

  • Manticore Search version Manticore 5.0.0 b4cb7da@220518
  • Mariadb version 10.5.15

Messages from log files:
/* Tue May 24 19:51:00.961 2022 conn 163 */ set time_zone=' 00:00' # error=Unknown session variable 'time_zone' in SET statement

Additional context
Found a similar issue https://forum.manticoresearch.com/t/got-error-10000-error-on-remote-system-1064-unknown-session-variable-time-zone-in-set-statement-from-federated /778.

@sanikolaev
Copy link
Collaborator

We probably need to add a dummy for set time_zone='+00:00', so it doesn't fail.

➜  ~ mysql -P9306 -h0
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.0.0 b4cb7da02@220518 dev from tarball

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> set time_zone='+00:00';
ERROR 1064 (42000): Unknown session variable 'time_zone' in SET statement
mysql>

@sanikolaev sanikolaev added the bug label May 26, 2022
@sanikolaev
Copy link
Collaborator

MRE

docker-compose:

# cat docker-compose.yml
version: '3'
services:
  manticore:
    image: manticoresearch/manticore:5.0.2
    environment:
      - QUERY_LOG_TO_STDOUT=true
  manticore_old:
    image: manticoresearch/manticore:4.2.0
    environment:
      - searchd_query_log_format=sphinxql
      - QUERY_LOG_TO_STDOUT=true
  db:
    image: mariadb:10.8.3
    command: --plugin-load-add=ha_federatedx
    environment:
      - MYSQL_DATABASE=default
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
      - MYSQL_ROOT_PASSWORD=

Start:

docker-compose up

Wait for mariadb to come up.

Problem:

snikolaev@dev:~/issue_813/maria$ docker-compose exec db mysql default -v
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.8.3-MariaDB-1:10.8.3+maria~jammy mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Reading history-file /root/.mysql_history
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [default]> CREATE TABLE t   (id INTEGER UNSIGNED NOT NULL, f VARCHAR(1024) NOT NULL, query VARCHAR(1024) NOT NULL, INDEX(query)) ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://FEDERATED@manticore:9306/DB/t';
--------------
CREATE TABLE t   (id INTEGER UNSIGNED NOT NULL, f VARCHAR(1024) NOT NULL, query VARCHAR(1024) NOT NULL, INDEX(query)) ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://FEDERATED@manticore:9306/DB/t'
--------------

ERROR 1434 (HY000): Can't create federated table. Foreign data src error:  database: 'DB'  username: 'FEDERATED'  hostname: 'manticore'

MariaDB [default]> CREATE TABLE t   (id INTEGER UNSIGNED NOT NULL, f VARCHAR(1024) NOT NULL, query VARCHAR(1024) NOT NULL, INDEX(query)) ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://FEDERATED@manticore_old:9306/DB/t';
--------------
CREATE TABLE t   (id INTEGER UNSIGNED NOT NULL, f VARCHAR(1024) NOT NULL, query VARCHAR(1024) NOT NULL, INDEX(query)) ENGINE=FEDERATED DEFAULT CHARSET=utf8 CONNECTION='mysql://FEDERATED@manticore_old:9306/DB/t'
--------------

ERROR 1434 (HY000): Can't create federated table. Foreign data src error:  database: 'DB'  username: 'FEDERATED'  hostname: 'manticore_old'

Query log:

manticore_1      | /* Tue Jun 28 04:15:43.197 2022 conn 2 */ set time_zone='+00:00' # error=Unknown session variable 'time_zone' in SET statement
manticore_old_1  | /* Tue Jun 28 04:16:00.603 2022 conn 2 */ set time_zone='+00:00' # error=unhandled statement type (value=9)

@sanikolaev
Copy link
Collaborator

Fixed in 03652ac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants