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

multi-query does not support [use db;] syntax #556

Closed
irene-coming opened this issue Jun 7, 2018 · 1 comment
Closed

multi-query does not support [use db;] syntax #556

irene-coming opened this issue Jun 7, 2018 · 1 comment
Assignees
Labels
verified issue's resolve was verified by tester
Milestone

Comments

@irene-coming
Copy link
Member

version:5.6.29-dble-2.18.02.4-20180606044319

int status = mysql_query(test_conn,
                          "use mytest ; \
                          DROP TABLE IF EXISTS test_table;\
                          CREATE TABLE test_table(id INT);\
                          INSERT INTO test_table VALUES(10);\
                          INSERT INTO test_table VALUES(20);\
                          INSERT INTO test_table VALUES(30);\
                          UPDATE test_table SET id=20 WHERE id=10;\
                          SELECT * FROM test_table;");

the above query will got err:
Unknown database 'mytest; DROP TABLE IF EXISTS test_table; CREATE TABLE test_table(id INT); INSERT INTO test_table VALUES(10); INSERT INTO test_table VALUES(20); INSERT INTO test_table VALUES(30); UPDATE test_table SET id=20 WHERE id=10; SELECT * FROM test_table'

complete c++ code for testing:

mysql_real_connect.txt
(change name post .txt to .cpp)
compile example:
g++ -g -o multiQuery.o -L/usr/local/mysql/lib -I/usr/local/mysql/include -lmysqlclient mysql_real_connect.cpp

@yanhuqing666 yanhuqing666 added this to the 2.18.02.4 milestone Jun 7, 2018
@sunsun314 sunsun314 added the resolve problem has been fixed by developer label Jun 7, 2018
@irene-coming irene-coming self-assigned this Jun 11, 2018
@irene-coming
Copy link
Member Author

irene-coming commented Jun 12, 2018

dble version:5.6.29-dble-2.18.02.4-20180611104156
前置:

    <schema dataNode="dn1" name="mytest" sqlMaxLimit="100">
        <table dataNode="dn1,dn3" name="test" type="global"/>
    </schema>

steps: execute the following 2 sqls in order

char sqls[] = "use mytest; \
                          DROP TABLE IF EXISTS test_table;\
                          CREATE TABLE test_table(id INT);\
                          begin; \
                          INSERT INTO test_table VALUES(10);\
                          INSERT INTO test_table VALUES(20);\
                          commit;";

    char sqls2[] = "lock tables test_table write; \
                          UPDATE test_table SET id=20 WHERE id=10;\
                          unlock tables; \
                          start transaction; \
                          INSERT INTO test_table VALUES(30);\
                          rollback; \
                          --i am comment; \
                          SELECT * FROM test_table/* comment */";

then dble will get err at "lock tables test_table write;", err msg:Err, can't find table define of test_table in schema:mytest

c++ test file:
mysql_real_connect.txt

@irene-coming irene-coming removed the resolve problem has been fixed by developer label Jun 12, 2018
yanhuqing666 added a commit that referenced this issue Jun 12, 2018
@yanhuqing666 yanhuqing666 added the resolve problem has been fixed by developer label Jun 12, 2018
yanhuqing666 added a commit that referenced this issue Jun 12, 2018
yanhuqing666 added a commit that referenced this issue Jun 12, 2018
@irene-coming irene-coming added verified issue's resolve was verified by tester and removed resolve problem has been fixed by developer labels Jun 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
verified issue's resolve was verified by tester
Projects
None yet
Development

No branches or pull requests

3 participants