{"action":"created","issue":{"url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1501","repository_url":"https://api.github.com/repos/MyCATApache/Mycat-Server","labels_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1501/labels{/name}","comments_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1501/comments","events_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1501/events","html_url":"https://github.com/MyCATApache/Mycat-Server/issues/1501","id":229299500,"number":1501,"title":"使用prepare，出现路由问题 ","user":{"login":"Youxrjack","id":28753616,"avatar_url":"https://avatars3.githubusercontent.com/u/28753616?v=3","gravatar_id":"","url":"https://api.github.com/users/Youxrjack","html_url":"https://github.com/Youxrjack","followers_url":"https://api.github.com/users/Youxrjack/followers","following_url":"https://api.github.com/users/Youxrjack/following{/other_user}","gists_url":"https://api.github.com/users/Youxrjack/gists{/gist_id}","starred_url":"https://api.github.com/users/Youxrjack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Youxrjack/subscriptions","organizations_url":"https://api.github.com/users/Youxrjack/orgs","repos_url":"https://api.github.com/users/Youxrjack/repos","events_url":"https://api.github.com/users/Youxrjack/events{/privacy}","received_events_url":"https://api.github.com/users/Youxrjack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-05-17T10:00:08Z","updated_at":"2017-05-18T03:23:31Z","closed_at":null,"body":"mysql> show @@datanode;\r\n+------+-----------------+-------+-------+--------+------+------+---------+------------+----------+---------+---------------+\r\n| NAME | DATHOST         | INDEX | TYPE  | ACTIVE | IDLE | SIZE | EXECUTE | TOTAL_TIME | MAX_TIME | MAX_SQL | RECOVERY_TIME |\r\n+------+-----------------+-------+-------+--------+------+------+---------+------------+----------+---------+---------------+\r\n| dn5  | mysqlab/cash    |     1 | mysql |      0 |    0 | 1000 |       3 |          0 |        0 |       0 |            -1 |\r\n| m01  | mysqlab/month01 |     1 | mysql |      0 |    0 | 1000 |       0 |          0 |        0 |       0 |            -1 |\r\n| m02  | mysqlab/month02 |     1 | mysql |      0 |    0 | 1000 |       0 |          0 |        0 |       0 |            -1 |\r\n| m03  | mysqlab/month03 |     1 | mysql |      0 |    0 | 1000 |       2 |          0 |        0 |       0 |            -1 |\r\n| m04  | mysqlab/month04 |     1 | mysql |      0 |    1 | 1000 |       3 |          0 |        0 |       0 |            -1 |\r\n| m05  | mysqlab/month05 |     1 | mysql |      0 |    0 | 1000 |       1 |          0 |        0 |       0 |            -1 |\r\n| m06  | mysqlab/month06 |     1 | mysql |      0 |    0 | 1000 |       1 |          0 |        0 |       0 |            -1 |\r\n| m07  | mysqlab/month07 |     1 | mysql |      0 |    0 | 1000 |       3 |          0 |        0 |       0 |            -1 |\r\n| m08  | mysqlab/month08 |     1 | mysql |      0 |    8 | 1000 |    5699 |          0 |        0 |       0 |            -1 |\r\n| m09  | mysqlab/month09 |     1 | mysql |      0 |    0 | 1000 |       1 |          0 |        0 |       0 |            -1 |\r\n| m10  | mysqlab/month10 |     1 | mysql |      0 |    0 | 1000 |       0 |          0 |        0 |       0 |            -1 |\r\n| m11  | mysqlab/month11 |     1 | mysql |      0 |    0 | 1000 |       0 |          0 |        0 |       0 |            -1 |\r\n| m12  | mysqlab/month12 |     1 | mysql |      0 |    0 | 1000 |       0 |          0 |        0 |       0 |            -1 |\r\n+------+-----------------+-------+-------+--------+------+------+---------+------------+----------+---------+---------------+\r\n\r\n\r\n\r\nmysql> explain prepare stmt from 'SELECT * FROM cash.mmm;';\r\n+-----------+---------------------------------------------+\r\n| DATA_NODE | SQL                                         |\r\n+-----------+---------------------------------------------+\r\n| m09       | prepare stmt from 'SELECT * FROM cash.mmm;' |\r\n+-----------+---------------------------------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql> explain prepare stmt from 'SELECT * FROM cash.mmm;';\r\n+-----------+---------------------------------------------+\r\n| DATA_NODE | SQL                                         |\r\n+-----------+---------------------------------------------+\r\n| dn5       | prepare stmt from 'SELECT * FROM cash.mmm;' |\r\n+-----------+---------------------------------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql> explain prepare stmt from 'SELECT * FROM cash.mmm;';\r\n+-----------+---------------------------------------------+\r\n| DATA_NODE | SQL                                         |\r\n+-----------+---------------------------------------------+\r\n| m09       | prepare stmt from 'SELECT * FROM cash.mmm;' |\r\n+-----------+---------------------------------------------+\r\n1 row in set (0.00 sec)\r\n\r\nmysql> explain prepare stmt from 'SELECT * FROM cash.mmm;';\r\n+-----------+---------------------------------------------+\r\n| DATA_NODE | SQL                                         |\r\n+-----------+---------------------------------------------+\r\n| m01       | prepare stmt from 'SELECT * FROM cash.mmm;' |\r\n+-----------+---------------------------------------------+\r\n1 row in set (0.00 sec)\r\n\r\n\r\n**mmm表没有做切分，按理prepare是在默认节点dn5上执行，但是路由却随机到了各个节点，添加注释后，会选择默认节点dn5，如下，但是添加注释应是对于做了切分的表才使用的！？**\r\n\r\nmysql> explain /*!mycat:sql=select 1 from mmm*/prepare stmt from 'SELECT * FROM cash.mmm;';\r\n+-----------+---------------------------------------------+\r\n| DATA_NODE | SQL                                         |\r\n+-----------+---------------------------------------------+\r\n| dn5       | prepare stmt from 'SELECT * FROM cash.mmm;' |\r\n+-----------+---------------------------------------------+\r\n1 row in set (0.00 sec)\r\n"},"comment":{"url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/comments/302290041","html_url":"https://github.com/MyCATApache/Mycat-Server/issues/1501#issuecomment-302290041","issue_url":"https://api.github.com/repos/MyCATApache/Mycat-Server/issues/1501","id":302290041,"user":{"login":"ZzzCrazyPig","id":11533543,"avatar_url":"https://avatars3.githubusercontent.com/u/11533543?v=3","gravatar_id":"","url":"https://api.github.com/users/ZzzCrazyPig","html_url":"https://github.com/ZzzCrazyPig","followers_url":"https://api.github.com/users/ZzzCrazyPig/followers","following_url":"https://api.github.com/users/ZzzCrazyPig/following{/other_user}","gists_url":"https://api.github.com/users/ZzzCrazyPig/gists{/gist_id}","starred_url":"https://api.github.com/users/ZzzCrazyPig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZzzCrazyPig/subscriptions","organizations_url":"https://api.github.com/users/ZzzCrazyPig/orgs","repos_url":"https://api.github.com/users/ZzzCrazyPig/repos","events_url":"https://api.github.com/users/ZzzCrazyPig/events{/privacy}","received_events_url":"https://api.github.com/users/ZzzCrazyPig/received_events","type":"User","site_admin":false},"created_at":"2017-05-18T03:23:31Z","updated_at":"2017-05-18T03:23:31Z","body":"恩 你可以看看注解是否满足你的要求，这个应该很少人用过"}}
{"actor":{"display_login":"ZzzCrazyPig"}}