LoginSignup
0
0

More than 5 years have passed since last update.

InfiniDB Cross Engine Support の確認

Posted at

InfiniDB Cross Engine Support の確認

InfiniDB を使っていて、リファレンステーブルを engine=MyISAM で作ったら
エラーとなった。

その時のメモ。

環境

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.8 (Santiago)

$ idbmysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73-log InfiniDB 4.6.6-1

Copyright (c) 2014, InfiniDB, Inc. and/or its affiliates. All rights reserved.
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

InfiniDB is a registered trademark of InfiniDB, Inc. 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.

テーブル作成

create database test1;

create table test1.test (
  account varchar(128)
 ,entrymonth int
) engine=InfiniDB;


create database test2;

create table test2.test (
  month int
 ,name varchar(32)
) engine=MyISAM;

データ登録

insert into test1.test values('hoge',1);

select * from test1.test;

+----------+------------+
| account  | entrymonth |
+----------+------------+
| hoge     |          1 |
+----------+------------+


insert into test2.test values(1,'January');

select * from test2.test;

+-------+---------+
| month | name    |
+-------+---------+
|     1 | January |
+-------+---------+

クエリー

select t1.account,t2.name from test1.test t1,test2.test t2 where t1.account like 'ho%' and t2.month=t1.entrymonth;
ERROR 138 (HY000): IDB-8001: CrossEngineSupport section in Calpont.xml is not properly configured.

デフォルトのままでは、エンジンをまたいだ連結クエリーができない。

Calpont.xml の確認・修正

$ vi $HOME/infinidb/etc/Calpont.xml
...
        <CrossEngineSupport>
                <Host>unassigned</Host>
                <Port>13202</Port>
                <User>unassigned</User>
                <Password/>
        </CrossEngineSupport>
...

host名をアサインする。

...
        <CrossEngineSupport>
                <Host>localhost</Host>
                <Port>13202</Port>
                <User>unassigned</User>
                <Password/>
        </CrossEngineSupport>
...

再起動&再クエリー

select t1.account,t2.name from test1.test t1,test2.test t2 where t1.account like 'ho%' and t2.month=t1.entrymonth;
ERROR 138 (HY000): IDB-8001: CrossEngineSupport section in Calpont.xml is not properly configured.

まだ駄目。

Calpont.xml の再確認・修正

User をアサインする。

...
        <CrossEngineSupport>
                <Host>localhost</Host>
                <Port>13202</Port>
                <User>root</User>
                <Password/>
        </CrossEngineSupport>
...

再再起動&再再クエリー

select t1.account,t2.name from test1.test t1,test2.test t2 where t1.account like 'ho%' and t2.month=t1.entrymonth;
+----------+---------+
| account  | name    |
+----------+---------+
| hoge     | January |
+----------+---------+

取れた。

けど、User=root はどうだろう?

Calpont.xml の再再確認・修正

User を登録済みの別ユーザーに変更する。

...
        <CrossEngineSupport>
                <Host>localhost</Host>
                <Port>13202</Port>
                <User>operator1</User>
                <Password>********</Password>
        </CrossEngineSupport>
...

再再再起動&再再再クエリー

mysql> select t1.account,t2.name from test1.test t1,test2.test t2 where t1.account like 'ho%' and t2.month=t1.entrymonth;
+----------+---------+
| account  | name    |
+----------+---------+
| hoge     | January |
+----------+---------+

これも取れた。

でも、Password=******** はどうだろう?

Calpont.xml の再再再確認・修正

Password 無しにしてみる。

...
        <CrossEngineSupport>
                <Host>localhost</Host>
                <Port>13202</Port>
                <User>operator1</User>
                <Password/>
        </CrossEngineSupport>
...

再再再再起動&再再再再クエリー

select t1.account,t2.name from test1.test t1,test2.test t2 where t1.account like 'ho%' and t2.month=t1.entrymonth;
ERROR 122 (HY000): fatal error in drizzle_con_connect()(23)(23)

新たなエラーが。。。

Calpont.xml の再再再再確認・修正

書き方を変えてみる。

...
        <CrossEngineSupport>
                <Host>localhost</Host>
                <Port>13202</Port>
                <User>operator1</User>
                <Password></Password>
        </CrossEngineSupport>
...

再再再再再起動&再再再再再クエリー

select t1.account,t2.name from test1.test t1,test2.test t2 where t1.account like 'ho%' and t2.month=t1.entrymonth;
ERROR 122 (HY000): fatal error in drizzle_con_connect()(23)(23)

変わらない。。。

この際、定義を元に戻して、MyISAM テーブルエンジンを InfiniDB に変更

create database test3;

create table test3.test (
  month int
 ,name varchar(32)
) engine=InfiniDB;


insert into test3.test values(1,'January');

select * from test3.test;
+-------+---------+
| month | name    |
+-------+---------+
|     1 | January |
+-------+---------+

再再再再再再起動&再再再再再再クエリー

select t1.account,t2.name from test1.test t1,test3.test t2 where t1.account like 'ho%' and t2.month=t1.entrymonth;
+----------+---------+
| account  | name    |
+----------+---------+
| hoge     | January |
+----------+---------+

普通に取れる。

考察

User を root もどうだろう?

だし

Password を書くのもどうだろう?

なんで、結局は同じエンジンにしておくのがいいのかも・・。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0