{"action":"created","comment":{"url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments/62862648","id":62862648,"diff_hunk":"@@ -1080,14 +1156,67 @@ class MySQLEmbedFunctionContext : public CInterfaceOf<IEmbedFunctionContext>\n                 cachedConnection = NULL;\n             }\n             conn.setown(new MySQLConnection(mysql_init(NULL)));\n-            if (!mysql_real_connect(*conn, server, user, password, database, port, NULL, 0))\n+            if (hasMySQLOpt)\n             {\n-                VStringBuffer err(\"mysql: failed to connect (%s)\", mysql_error(*conn));\n-                rtlFail(0, err.str());\n+                ForEachItemIn(idx, opts)\n+                {\n+                    const char *opt = opts.item(idx);\n+                    if (strnicmp(opt, \"MYSQL_\", 6)==0)\n+                    {\n+                        const char *val = strchr(opt, '=');\n+                        StringBuffer optName(opt);\n+                        if (val)\n+                        {\n+                            optName.setLength(val-opt);\n+                            val++;\n+                        }\n+                        MySQLOptionDefinition &optDef = lookupOption(optName);\n+                        int rc;\n+                        if (optDef.paramType == ParamTypeNone)\n+                        {\n+                            if (val)\n+                                failx(\"Option %s does not take a value\", optName.str());\n+                            rc = mysql_options(*conn, optDef.option, nullptr);\n+                        }\n+                        else\n+                        {\n+                            if (!val)\n+                                failx(\"Option %s requires a value\", optName.str());\n+                            switch (optDef.paramType)\n+                            {\n+                            case ParamTypeString:\n+                                rc = mysql_options(*conn, optDef.option, val);\n+                                break;\n+                            case ParamTypeUInt:\n+                                {\n+                                    unsigned int oval = strtoul(val, nullptr, 10);","path":"plugins/mysql/mysqlembed.cpp","position":208,"original_position":200,"commit_id":"0abf11159d084ffa971dddd4fde9c508b6e9c038","original_commit_id":"68acf36f8a93d0b0aec4b8dad7a8251ab391d8a6","user":{"login":"ghalliday","id":902490,"avatar_url":"https://avatars.githubusercontent.com/u/902490?v=3","gravatar_id":"","url":"https://api.github.com/users/ghalliday","html_url":"https://github.com/ghalliday","followers_url":"https://api.github.com/users/ghalliday/followers","following_url":"https://api.github.com/users/ghalliday/following{/other_user}","gists_url":"https://api.github.com/users/ghalliday/gists{/gist_id}","starred_url":"https://api.github.com/users/ghalliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghalliday/subscriptions","organizations_url":"https://api.github.com/users/ghalliday/orgs","repos_url":"https://api.github.com/users/ghalliday/repos","events_url":"https://api.github.com/users/ghalliday/events{/privacy}","received_events_url":"https://api.github.com/users/ghalliday/received_events","type":"User","site_admin":false},"body":"I think this is fine - They will have had to explicitly set it, so it will only change the behaviour if an option has been set.\r\n","created_at":"2016-05-11T14:51:21Z","updated_at":"2016-05-11T14:51:21Z","html_url":"https://github.com/hpcc-systems/HPCC-Platform/pull/8629#discussion_r62862648","pull_request_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8629","_links":{"self":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments/62862648"},"html":{"href":"https://github.com/hpcc-systems/HPCC-Platform/pull/8629#discussion_r62862648"},"pull_request":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8629"}}},"pull_request":{"url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8629","id":69468317,"html_url":"https://github.com/hpcc-systems/HPCC-Platform/pull/8629","diff_url":"https://github.com/hpcc-systems/HPCC-Platform/pull/8629.diff","patch_url":"https://github.com/hpcc-systems/HPCC-Platform/pull/8629.patch","issue_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/8629","number":8629,"state":"open","locked":false,"title":"HPCC-15478 MySQL embed supports setting various MySQL options","user":{"login":"richardkchapman","id":900820,"avatar_url":"https://avatars.githubusercontent.com/u/900820?v=3","gravatar_id":"","url":"https://api.github.com/users/richardkchapman","html_url":"https://github.com/richardkchapman","followers_url":"https://api.github.com/users/richardkchapman/followers","following_url":"https://api.github.com/users/richardkchapman/following{/other_user}","gists_url":"https://api.github.com/users/richardkchapman/gists{/gist_id}","starred_url":"https://api.github.com/users/richardkchapman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardkchapman/subscriptions","organizations_url":"https://api.github.com/users/richardkchapman/orgs","repos_url":"https://api.github.com/users/richardkchapman/repos","events_url":"https://api.github.com/users/richardkchapman/events{/privacy}","received_events_url":"https://api.github.com/users/richardkchapman/received_events","type":"User","site_admin":false},"body":"See documentation for mysql_options for the options that are\r\navailable and their meanings...\r\n\r\nSigned-off-by: Richard Chapman <rchapman@hpccsystems.com>","created_at":"2016-05-10T08:41:29Z","updated_at":"2016-05-11T14:51:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d28851ebbdfe536eec761547ac3bdc5c67a24ac0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8629/commits","review_comments_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8629/comments","review_comment_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/8629/comments","statuses_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/statuses/0abf11159d084ffa971dddd4fde9c508b6e9c038","head":{"label":"richardkchapman:mysql_options_60","ref":"mysql_options_60","sha":"0abf11159d084ffa971dddd4fde9c508b6e9c038","user":{"login":"richardkchapman","id":900820,"avatar_url":"https://avatars.githubusercontent.com/u/900820?v=3","gravatar_id":"","url":"https://api.github.com/users/richardkchapman","html_url":"https://github.com/richardkchapman","followers_url":"https://api.github.com/users/richardkchapman/followers","following_url":"https://api.github.com/users/richardkchapman/following{/other_user}","gists_url":"https://api.github.com/users/richardkchapman/gists{/gist_id}","starred_url":"https://api.github.com/users/richardkchapman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardkchapman/subscriptions","organizations_url":"https://api.github.com/users/richardkchapman/orgs","repos_url":"https://api.github.com/users/richardkchapman/repos","events_url":"https://api.github.com/users/richardkchapman/events{/privacy}","received_events_url":"https://api.github.com/users/richardkchapman/received_events","type":"User","site_admin":false},"repo":{"id":2031005,"name":"HPCC-Platform","full_name":"richardkchapman/HPCC-Platform","owner":{"login":"richardkchapman","id":900820,"avatar_url":"https://avatars.githubusercontent.com/u/900820?v=3","gravatar_id":"","url":"https://api.github.com/users/richardkchapman","html_url":"https://github.com/richardkchapman","followers_url":"https://api.github.com/users/richardkchapman/followers","following_url":"https://api.github.com/users/richardkchapman/following{/other_user}","gists_url":"https://api.github.com/users/richardkchapman/gists{/gist_id}","starred_url":"https://api.github.com/users/richardkchapman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richardkchapman/subscriptions","organizations_url":"https://api.github.com/users/richardkchapman/orgs","repos_url":"https://api.github.com/users/richardkchapman/repos","events_url":"https://api.github.com/users/richardkchapman/events{/privacy}","received_events_url":"https://api.github.com/users/richardkchapman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/richardkchapman/HPCC-Platform","description":"HPCC Systems big data solution, community edition","fork":true,"url":"https://api.github.com/repos/richardkchapman/HPCC-Platform","forks_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/forks","keys_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/teams","hooks_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/hooks","issue_events_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/issues/events{/number}","events_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/events","assignees_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/assignees{/user}","branches_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/branches{/branch}","tags_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/tags","blobs_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/statuses/{sha}","languages_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/languages","stargazers_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/stargazers","contributors_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/contributors","subscribers_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/subscribers","subscription_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/subscription","commits_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/contents/{+path}","compare_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/merges","archive_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/downloads","issues_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/issues{/number}","pulls_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/pulls{/number}","milestones_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/milestones{/number}","notifications_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/labels{/name}","releases_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/releases{/id}","deployments_url":"https://api.github.com/repos/richardkchapman/HPCC-Platform/deployments","created_at":"2011-07-11T15:22:03Z","updated_at":"2015-02-12T17:31:52Z","pushed_at":"2016-05-11T12:35:58Z","git_url":"git://github.com/richardkchapman/HPCC-Platform.git","ssh_url":"git@github.com:richardkchapman/HPCC-Platform.git","clone_url":"https://github.com/richardkchapman/HPCC-Platform.git","svn_url":"https://github.com/richardkchapman/HPCC-Platform","homepage":"www.hpccsystems.com","size":165711,"stargazers_count":5,"watchers_count":5,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":5,"default_branch":"master"}},"base":{"label":"hpcc-systems:candidate-6.0.0","ref":"candidate-6.0.0","sha":"e6b106589afa802a7ca96124c1a07f7896c51fd3","user":{"login":"hpcc-systems","id":900867,"avatar_url":"https://avatars.githubusercontent.com/u/900867?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcc-systems","html_url":"https://github.com/hpcc-systems","followers_url":"https://api.github.com/users/hpcc-systems/followers","following_url":"https://api.github.com/users/hpcc-systems/following{/other_user}","gists_url":"https://api.github.com/users/hpcc-systems/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcc-systems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcc-systems/subscriptions","organizations_url":"https://api.github.com/users/hpcc-systems/orgs","repos_url":"https://api.github.com/users/hpcc-systems/repos","events_url":"https://api.github.com/users/hpcc-systems/events{/privacy}","received_events_url":"https://api.github.com/users/hpcc-systems/received_events","type":"Organization","site_admin":false},"repo":{"id":2030681,"name":"HPCC-Platform","full_name":"hpcc-systems/HPCC-Platform","owner":{"login":"hpcc-systems","id":900867,"avatar_url":"https://avatars.githubusercontent.com/u/900867?v=3","gravatar_id":"","url":"https://api.github.com/users/hpcc-systems","html_url":"https://github.com/hpcc-systems","followers_url":"https://api.github.com/users/hpcc-systems/followers","following_url":"https://api.github.com/users/hpcc-systems/following{/other_user}","gists_url":"https://api.github.com/users/hpcc-systems/gists{/gist_id}","starred_url":"https://api.github.com/users/hpcc-systems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hpcc-systems/subscriptions","organizations_url":"https://api.github.com/users/hpcc-systems/orgs","repos_url":"https://api.github.com/users/hpcc-systems/repos","events_url":"https://api.github.com/users/hpcc-systems/events{/privacy}","received_events_url":"https://api.github.com/users/hpcc-systems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hpcc-systems/HPCC-Platform","description":"HPCC Systems (High Performance Computing Cluster) is an open source, massive parallel-processing computing platform for big data processing and analytics.","fork":false,"url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform","forks_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/forks","keys_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/teams","hooks_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/hooks","issue_events_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/events{/number}","events_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/events","assignees_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/assignees{/user}","branches_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/branches{/branch}","tags_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/tags","blobs_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/statuses/{sha}","languages_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/languages","stargazers_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/stargazers","contributors_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/contributors","subscribers_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/subscribers","subscription_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/subscription","commits_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/contents/{+path}","compare_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/merges","archive_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/downloads","issues_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues{/number}","pulls_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls{/number}","milestones_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/milestones{/number}","notifications_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/labels{/name}","releases_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/releases{/id}","deployments_url":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/deployments","created_at":"2011-07-11T14:29:51Z","updated_at":"2016-04-26T14:13:36Z","pushed_at":"2016-05-11T14:48:03Z","git_url":"git://github.com/hpcc-systems/HPCC-Platform.git","ssh_url":"git@github.com:hpcc-systems/HPCC-Platform.git","clone_url":"https://github.com/hpcc-systems/HPCC-Platform.git","svn_url":"https://github.com/hpcc-systems/HPCC-Platform","homepage":"http://hpccsystems.com","size":195445,"stargazers_count":275,"watchers_count":275,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":144,"mirror_url":null,"open_issues_count":420,"forks":144,"open_issues":420,"watchers":275,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8629"},"html":{"href":"https://github.com/hpcc-systems/HPCC-Platform/pull/8629"},"issue":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/8629"},"comments":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/issues/8629/comments"},"review_comments":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8629/comments"},"review_comment":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/pulls/8629/commits"},"statuses":{"href":"https://api.github.com/repos/hpcc-systems/HPCC-Platform/statuses/0abf11159d084ffa971dddd4fde9c508b6e9c038"}}}}