{"action":"created","issue":{"url":"https://api.github.com/repos/mysql-d/mysql-native/issues/60","labels_url":"https://api.github.com/repos/mysql-d/mysql-native/issues/60/labels{/name}","comments_url":"https://api.github.com/repos/mysql-d/mysql-native/issues/60/comments","events_url":"https://api.github.com/repos/mysql-d/mysql-native/issues/60/events","html_url":"https://github.com/mysql-d/mysql-native/issues/60","id":99693414,"number":60,"title":"Proper using of execSQL() when we don't care about rows affected","user":{"login":"whitebyte","id":7704186,"avatar_url":"https://avatars.githubusercontent.com/u/7704186?v=3","gravatar_id":"","url":"https://api.github.com/users/whitebyte","html_url":"https://github.com/whitebyte","followers_url":"https://api.github.com/users/whitebyte/followers","following_url":"https://api.github.com/users/whitebyte/following{/other_user}","gists_url":"https://api.github.com/users/whitebyte/gists{/gist_id}","starred_url":"https://api.github.com/users/whitebyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitebyte/subscriptions","organizations_url":"https://api.github.com/users/whitebyte/orgs","repos_url":"https://api.github.com/users/whitebyte/repos","events_url":"https://api.github.com/users/whitebyte/events{/privacy}","received_events_url":"https://api.github.com/users/whitebyte/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-07T17:29:32Z","updated_at":"2015-08-08T18:42:17Z","closed_at":"2015-08-08T18:42:17Z","body":"```D\r\n// ...\r\nstring query = \"DROP TABLE `users`\";\r\nauto cmd = new Command(c, query);\r\nuint rowsAffected; // <-- don't need it!\r\ncmd.execSQL(rowsAffected);\r\n```\r\n\r\nThere are situations when we absolutely don't care about how much rows affected by our query. What is the proper way of using execSQL() without creating redunant variable?"},"comment":{"url":"https://api.github.com/repos/mysql-d/mysql-native/issues/comments/129033017","html_url":"https://github.com/mysql-d/mysql-native/issues/60#issuecomment-129033017","issue_url":"https://api.github.com/repos/mysql-d/mysql-native/issues/60","id":129033017,"user":{"login":"whitebyte","id":7704186,"avatar_url":"https://avatars.githubusercontent.com/u/7704186?v=3","gravatar_id":"","url":"https://api.github.com/users/whitebyte","html_url":"https://github.com/whitebyte","followers_url":"https://api.github.com/users/whitebyte/followers","following_url":"https://api.github.com/users/whitebyte/following{/other_user}","gists_url":"https://api.github.com/users/whitebyte/gists{/gist_id}","starred_url":"https://api.github.com/users/whitebyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitebyte/subscriptions","organizations_url":"https://api.github.com/users/whitebyte/orgs","repos_url":"https://api.github.com/users/whitebyte/repos","events_url":"https://api.github.com/users/whitebyte/events{/privacy}","received_events_url":"https://api.github.com/users/whitebyte/received_events","type":"User","site_admin":false},"created_at":"2015-08-08T18:42:17Z","updated_at":"2015-08-08T18:42:17Z","body":"```d\r\ncmd.execSQL(uint ra);\r\n```\r\n\r\nUnfortunately this string seems to be illegal in D.\r\n\r\nCurrently I'm using a simple overloaded method:\r\n\r\n```d\r\n    \r\n    // right after original execSQL in commands.d\r\n    bool execSQL()\r\n    {\r\n        scope(failure) _con.kill();\r\n\r\n        _con.sendCmd(CommandType.QUERY, _sql);\r\n        _fieldCount = 0;\r\n        ubyte[] packet = _con.getPacket();\r\n        bool rv;\r\n        if (packet.front == ResultPacketMarker.ok || packet.front == ResultPacketMarker.error)\r\n        {\r\n            _con.resetPacket();\r\n            auto okp = OKErrorPacket(packet);\r\n            enforcePacketOK(okp);\r\n            _con._serverStatus = okp.serverStatus;\r\n            _insertID = okp.insertID;\r\n            rv = false;\r\n        }\r\n        else\r\n        {\r\n            // There was presumably a result set\r\n            assert(packet.front >= 1 && packet.front <= 250); // ResultSet packet header should have this value\r\n            _headersPending = _rowsPending = true;\r\n            _pendingBinary = false;\r\n            auto lcb = packet.consumeIfComplete!LCB();\r\n            assert(!lcb.isNull);\r\n            assert(!lcb.isIncomplete);\r\n            _fieldCount = cast(ushort)lcb.value;\r\n            assert(_fieldCount == lcb.value);\r\n            rv = true;\r\n        }\r\n        return rv;\r\n    }\r\n```\r\n\r\nIt works for me, so technically this issue may be closed. Are there better ways of resolving this? should I make PR for this?"}}