actiontech / dble

A High Scalability Middle-ware for MySQL Sharding
https://opensource.actionsky.com
GNU General Public License v2.0
1.09k stars 317 forks source link

druid wrong when execute related sql #657

Open yexiaoli88 opened 6 years ago

yexiaoli88 commented 6 years ago

rule.xml

<tableRule name="mod-long">
        <rule>
            <columns>id</columns>
            <algorithm>sharding</algorithm>
        </rule>
</tableRule>
<function name="sharding" class="Hash">
        <property name="partitionCount">4</property>
        <property name="partitionLength">1</property>
</function>

schema.xml

 <table name="a_test" primaryKey="id" dataNode="dn1,dn2,dn3,dn4" rule="mod-long" />
 <table name="test_global" dataNode="dn1,dn2,dn3,dn4" type="global"/>
mysql> select * from test_no_shard where R_NAME=_latin1 b'1000001';
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select * from test_no_shard where R_NAME=_utf8 0b1000001 COLLATE utf8_danish_ci;
ERROR 1064 (HY000): sql syntax error, no terminated. LITERAL_INT
mysql> select *,_latin1 b'1000001' from test_no_shard;
ERROR 1064 (HY000): sql syntax error, no terminated. LITERAL_CHARS
mysql> select * from a_test t use key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select * from a_test t ignore key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select * from a_test t ignore key(k_1) ignore index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select * from a_test t force key(k_1) force index(pad_index);
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select id,t_id,name,pad from test_global t use key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select id,t_id,name,pad from test_global t ignore key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select id,t_id,name,pad from test_global t ignore key(k_1) ignore index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select id,t_id,name,pad from test_global t force key(k_1) force index(pad_index);
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select * from a_test_no_shard t use key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select * from a_test_no_shard t ignore key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select * from a_test_no_shard t ignore key(k_1) ignore index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select * from a_test_no_shard t force key(k_1) force index(pad_index);
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select id,t_id,name,pad from a_test t use key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select id,t_id,name,pad from a_test t ignore key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select id,t_id,name,pad from a_test t ignore key(k_1) ignore index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select id,t_id,name,pad from a_test t force key(k_1) force index(pad_index);
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select id,t_id,name,pad from a_test t ignore key(k_1) force index(pad_index);
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> alter table t change c c national character varying(20);
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> CREATE INDEX inx_id ON aly_test (id) comment '测试';
ERROR 1064 (HY000): sql syntax error, no terminated. COMMENT
mysql> SELECT @abc123, @123abc, @row_format=1, @$ := @t1+@t2+@t3;
ERROR 1064 (HY000): sql syntax error, no terminated. COLONEQ

/label ~BUG

yanhuqing666 commented 5 years ago

need reproduce after update druid @yexiaoli88

FlyingMao commented 5 years ago

version :5.6.29-dble-9.9.9.9-6d0b936-20181101023043 still have bug:

mysql> select * from test_no_shard where R_NAME=_latin1 b'1000001';
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select * from test_no_shard where R_NAME=_utf8 0b1000001 COLLATE utf8_danish_ci;
ERROR 1064 (HY000): sql syntax error, no terminated. LITERAL_INT
mysql> select *,_latin1 b'1000001' from test_no_shard;
ERROR 1064 (HY000): sql syntax error, no terminated. LITERAL_CHARS
mysql> select * from a_test t use key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select * from a_test t ignore key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select * from a_test t ignore key(k_1) ignore index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select id,t_id,name,pad from test_global t use key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select id,t_id,name,pad from test_global t ignore key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select id,t_id,name,pad from test_global t ignore key(k_1) ignore index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select * from a_test_no_shard t use key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select * from a_test_no_shard t ignore key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select * from a_test_no_shard t ignore key(k_1) ignore index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> select id,t_id,name,pad from a_test t use key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select id,t_id,name,pad from a_test t ignore key(k_1) use index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. USE
mysql> select id,t_id,name,pad from a_test t ignore key(k_1) ignore index(pad_index) use index();
ERROR 1064 (HY000): sql syntax error, no terminated. IDENTIFIER
mysql> SELECT @abc123, @123abc, @row_format=1, @$ := @t1+@t2+@t3;
ERROR 1064 (HY000): sql syntax error, no terminated. COLONEQ
FlyingMao commented 5 years ago

788