{"action":"created","issue":{"url":"https://api.github.com/repos/greenlion/swanhart-tools/issues/151","repository_url":"https://api.github.com/repos/greenlion/swanhart-tools","labels_url":"https://api.github.com/repos/greenlion/swanhart-tools/issues/151/labels{/name}","comments_url":"https://api.github.com/repos/greenlion/swanhart-tools/issues/151/comments","events_url":"https://api.github.com/repos/greenlion/swanhart-tools/issues/151/events","html_url":"https://github.com/greenlion/swanhart-tools/issues/151","id":158344746,"number":151,"title":"Shard-Query: sq_helper procedure doesn't work","user":{"login":"msestak","id":5228178,"avatar_url":"https://avatars.githubusercontent.com/u/5228178?v=3","gravatar_id":"","url":"https://api.github.com/users/msestak","html_url":"https://github.com/msestak","followers_url":"https://api.github.com/users/msestak/followers","following_url":"https://api.github.com/users/msestak/following{/other_user}","gists_url":"https://api.github.com/users/msestak/gists{/gist_id}","starred_url":"https://api.github.com/users/msestak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msestak/subscriptions","organizations_url":"https://api.github.com/users/msestak/orgs","repos_url":"https://api.github.com/users/msestak/repos","events_url":"https://api.github.com/users/msestak/events{/privacy}","received_events_url":"https://api.github.com/users/msestak/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-06-03T11:14:51Z","updated_at":"2016-06-10T13:19:58Z","closed_at":null,"body":"I tried your example from blog post https://shardquery.com/2015/03/02/access-shard-query-with-the-mysql-client-without-using-mysql-proxy/\r\n\r\n     mysql> call shard_query.sq_helper(\"select * from dim_date limit 2\", \"\", 'test','testtab',1,1);\r\nERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`test`.`testtab`(D_DateKey text,D_Date text,D_DayOfWeek text,D_Month text,D_Year' at line 1\r\n\r\n    mysql> use shard1; select * from dim_date limit 2;\r\nworks fine. Running it with:\r\n    \r\n    php run_query\r\n    select * from dim_date limit 2;\r\n\r\nworks too.\r\n\r\nProcedure is listed as installed.\r\n\r\n    mysql> SELECT ROUTINE_NAME, ROUTINE_SCHEMA FROM information_schema.routines\\G\r\n    *************************** 1. row ***************************\r\n    ROUTINE_NAME: sq_helper\r\n    ROUTINE_SCHEMA: shard_query\r\n    *************************** 2. row ***************************\r\n    ROUTINE_NAME: sq_throw\r\n    ROUTINE_SCHEMA: shard_query\r\n    2 rows in set (0.00 sec)\r\n\r\nCan you point me how to make it work? I just wanted to run some queries against Shard-Query and thought this is the simplest way.\r\n"},"comment":{"url":"https://api.github.com/repos/greenlion/swanhart-tools/issues/comments/225179796","html_url":"https://github.com/greenlion/swanhart-tools/issues/151#issuecomment-225179796","issue_url":"https://api.github.com/repos/greenlion/swanhart-tools/issues/151","id":225179796,"user":{"login":"greenlion","id":465334,"avatar_url":"https://avatars.githubusercontent.com/u/465334?v=3","gravatar_id":"","url":"https://api.github.com/users/greenlion","html_url":"https://github.com/greenlion","followers_url":"https://api.github.com/users/greenlion/followers","following_url":"https://api.github.com/users/greenlion/following{/other_user}","gists_url":"https://api.github.com/users/greenlion/gists{/gist_id}","starred_url":"https://api.github.com/users/greenlion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greenlion/subscriptions","organizations_url":"https://api.github.com/users/greenlion/orgs","repos_url":"https://api.github.com/users/greenlion/repos","events_url":"https://api.github.com/users/greenlion/events{/privacy}","received_events_url":"https://api.github.com/users/greenlion/received_events","type":"User","site_admin":false},"created_at":"2016-06-10T13:19:58Z","updated_at":"2016-06-10T13:19:58Z","body":"I missed gearman command line.  Did you compile the gearman UDF yourself?  I had this problem with binary version in past.  Try compiling it and using that version.\n\nSent from my iPhone\n\n> On Jun 10, 2016, at 6:33 AM, Martin Sebastijan Šestak <notifications@github.com> wrote:\n> \n> Hi,\n> \n> I modified sq_helper to return v_args.\n> \n> mysql> call shard_query.sq_helper2(\"select * from dim_date limit 2\", \"\", 'test','testtab',1,1);\n> +-----------------------------------------------------------+\n> | v_args                                                    |\n> +-----------------------------------------------------------+\n> | {\"sql\":\"select * from dim_date limit 2\",\"schema_name\":\"\"} |\n> +-----------------------------------------------------------+\n> 1 row in set (0.01 sec)\n> \n> +---------+---------+\n> | @create | @insert |\n> +---------+---------+\n> | NULL    | NULL    |\n> +---------+---------+\n> 1 row in set (0.01 sec)\n> \n> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1\n> mysql> select gman_do('shard_query_worker', '\"sql\":\"select * from dim_date limit 2\",\"schema_name\":\"\"');\n> +------------------------------------------------------------------------------------------+\n> | gman_do('shard_query_worker', '\"sql\":\"select * from dim_date limit 2\",\"schema_name\":\"\"') |\n> +------------------------------------------------------------------------------------------+\n> | NULL                                                                                     |\n> +------------------------------------------------------------------------------------------+\n> 1 row in set (0.00 sec)\n> I'm using default setup for gearman:\n> \n> gearmand -d -p 7001 -L 127.0.0.1\n> —\n> You are receiving this because you commented.\n> Reply to this email directly, view it on GitHub, or mute the thread.\n> \n"}}
{"actor":{"display_login":"greenlion"}}