{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/9461","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9461/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9461/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9461/events","html_url":"https://github.com/joomla/joomla-cms/pull/9461","id":141709480,"number":9461,"title":"Fix Component + Library installation for PDO driver with strict mode","user":{"login":"wilsonge","id":1986000,"avatar_url":"https://avatars.githubusercontent.com/u/1986000?v=3","gravatar_id":"","url":"https://api.github.com/users/wilsonge","html_url":"https://github.com/wilsonge","followers_url":"https://api.github.com/users/wilsonge/followers","following_url":"https://api.github.com/users/wilsonge/following{/other_user}","gists_url":"https://api.github.com/users/wilsonge/gists{/gist_id}","starred_url":"https://api.github.com/users/wilsonge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilsonge/subscriptions","organizations_url":"https://api.github.com/users/wilsonge/orgs","repos_url":"https://api.github.com/users/wilsonge/repos","events_url":"https://api.github.com/users/wilsonge/events{/privacy}","received_events_url":"https://api.github.com/users/wilsonge/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-03-17T21:19:29Z","updated_at":"2016-03-18T16:03:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/9461","html_url":"https://github.com/joomla/joomla-cms/pull/9461","diff_url":"https://github.com/joomla/joomla-cms/pull/9461.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/9461.patch"},"body":"This fixes some of the issues described in https://github.com/joomla/joomla-cms/issues/9447 and the issue described in https://github.com/joomla/joomla-cms/issues/9455\r\n\r\nTo test try and install a component like weblinks through Extension Manager with the PDO Driver (note that you must apply https://github.com/joomla-extensions/weblinks/commit/ae8e62c1bc222e26269d9bb104e9794db96d00a5 to the weblinks 3.4.1 release for this to work). You must have strict mode enabled to replicate this problem. If you don't have MySql 5.6.6+ (and even in some other cases it's worth doing this) you can emulate the error by setting the sql_mode in pdomydriver file. For that, add, after this line https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/pdomysql.php#L149 the following code:\r\n\r\n```\r\nstatic $sqlMode = null;\r\nif (is_null($sqlMode))\r\n{\r\n    $this->connection->query(\"SET @@SESSION.sql_mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION';\");\r\n    $sqlMode = true;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/198428121","html_url":"https://github.com/joomla/joomla-cms/pull/9461#issuecomment-198428121","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/9461","id":198428121,"user":{"login":"andrepereiradasilva","id":9630530,"avatar_url":"https://avatars.githubusercontent.com/u/9630530?v=3","gravatar_id":"","url":"https://api.github.com/users/andrepereiradasilva","html_url":"https://github.com/andrepereiradasilva","followers_url":"https://api.github.com/users/andrepereiradasilva/followers","following_url":"https://api.github.com/users/andrepereiradasilva/following{/other_user}","gists_url":"https://api.github.com/users/andrepereiradasilva/gists{/gist_id}","starred_url":"https://api.github.com/users/andrepereiradasilva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrepereiradasilva/subscriptions","organizations_url":"https://api.github.com/users/andrepereiradasilva/orgs","repos_url":"https://api.github.com/users/andrepereiradasilva/repos","events_url":"https://api.github.com/users/andrepereiradasilva/events{/privacy}","received_events_url":"https://api.github.com/users/andrepereiradasilva/received_events","type":"User","site_admin":false},"created_at":"2016-03-18T16:03:40Z","updated_at":"2016-03-18T16:03:40Z","body":"@wilsonge @nikosdion i can't reproduce the problem, to check if this works, but since, for what i understand, the issue is:\r\n\r\n> HY000 SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.\r\n\r\nAdding a `PDO::MYSQL_ATTR_USE_BUFFERED_QUERY` flag to the beginning of the pdomysql.php connect method so it can be used on PDO connect probably works.\r\n\r\n```php\r\n\tpublic function connect()\r\n\t{\r\n\t\t$this->options['driverOptions'][PDO::MYSQL_ATTR_USE_BUFFERED_QUERY] = true;\r\n\t\t// [...]\r\n\t}\r\n```\r\n\r\nIn https://github.com/joomla/joomla-cms/blob/staging/libraries/joomla/database/driver/pdomysql.php#L103-L104"}}