Fix sql.php --json behavior
authorGergő Tisza <tgr.huwiki@gmail.com>
Mon, 17 Dec 2018 05:06:32 +0000 (21:06 -0800)
committerGergő Tisza <tgr.huwiki@gmail.com>
Mon, 17 Dec 2018 05:09:17 +0000 (21:09 -0800)
commit3f43c57024652e2a2fc718c574be327d6e8717d9
tree4f137bdee6400caaf740bf0abb7962ec060feec3
parent50af36e359d170cc20eb30e97027e862c3d96c15
Fix sql.php --json behavior

* return empty array when the query had no result (instead of
  falling back into non-JSON mode)
* return JSON for write queries as well
* retain legacy behavior in non-JSON mode for empty SELECTs, just in
  case somebody relied on it

Change-Id: Iaefbb443650a395278d1cc9ab6aa668b13b217c9
maintenance/sql.php