6.0.0-git
2019-06-16

[#14216] /admin/sqlshell.php fails on UPDATE query: Call to a member function fetch_array() on boolean
Summary /admin/sqlshell.php fails on UPDATE query: Call to a member function fetch_array() on boolean
Queue Horde Framework Packages
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester 3rdpartybugs (at) object (dot) earth
Created 2016-01-06 (1257 days ago)
Due
Updated 2017-10-20 (604 days ago)
Assigned 2016-01-06 (1257 days ago)
Resolved 2016-01-06 (1257 days ago)
Milestone
Patch No

History
2017-10-20 20:33:43 Git Commit Comment #6 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 3b986c3d83fcea9c7c800232897c962810d38315
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed, 06 Jan 2016 13:37:18 -0500

Bug: 14216 Attempt to report back meaningful results.

For non-select statements, report back number of rows affected.

  M admin/sqlshell.php

https://github.com/horde/base/commit/3b986c3d83fcea9c7c800232897c962810d38315
2016-01-06 18:39:18 Michael Rubinsky State ⇒ Resolved
 
2016-01-06 18:38:56 Git Commit Comment #5 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit 157c4adcbd56117142c2fba88bb10d775e62f9c1
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Jan 6 13:35:21 2016 -0500

     Bug: 14216 Attempt to report back meaningful results.

     For non-select statements, report back number of rows affected.

  horde/admin/sqlshell.php |   47 +++++++++++++++++++++++++++++++++++++++++----
  1 files changed, 42 insertions(+), 5 deletions(-)

http://github.com/horde/horde/commit/157c4adcbd56117142c2fba88bb10d775e62f9c1
2016-01-06 18:36:39 Git Commit Comment #4 Reply to this comment
Changes have been made in Git (master):

commit b754ca323b06f94892b20e285a04cfceaac57b2c
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Jan 6 13:35:21 2016 -0500

     Bug: 14216 Attempt to report back meaningful results.

     For non-select statements, report back number of rows affected.

  horde/admin/sqlshell.php |   47 +++++++++++++++++++++++++++++++++++++++++----
  1 files changed, 42 insertions(+), 5 deletions(-)

http://github.com/horde/horde/commit/b754ca323b06f94892b20e285a04cfceaac57b2c
2016-01-06 18:23:52 Michael Rubinsky Comment #3 Reply to this comment
There really isn't an easy solution here because of the way the 
Horde_Db package is structured. The best solution, IMO, would be to 
attempt to simply sniff out the type of query being performed and call 
the appropriate method. I should note that your UPDATE statement most 
likely did work. The issue is in the code that reports the result set 
back to the sqlshell controller.
2016-01-06 17:49:48 Michael Rubinsky Comment #2
Assigned to Michael Rubinsky
State ⇒ Assigned
Reply to this comment
The issue is we issue a $db->select() call from the sqlshell, which 
obviously assumes the SQL is a SELECT.  I see that the execute method 
is deprecated, so we need to check the return type before moving on.


2016-01-06 17:30:46 3rdpartybugs (at) object (dot) earth Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ /admin/sqlshell.php fails on UPDATE query: Call to a member function fetch_array() on boolean
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
Using the SQL Shell in the admin webinterface: 
Administration->Configuration->SQL Shell

Fails with an exception upon UPDATE-query execution.
Example query:
UPDATE imp_sentmail SET sentmail_who=1 WHERE sentmail_who=1


Log error mesage:
HORDE: [horde] Call to a member function fetch_array() on boolean [pid 
12311 on line 50 of "/usr/share/php/Horde/Db/Adapter/Mysqli/Result.php"]

Webinterface exception message:
ErrorException Object
(
     [message:protected] => Call to a member function fetch_array() on boolean
     [string:Exception:private] =>
     [code:protected] => 0
     [file:protected] => /usr/share/php/Horde/Db/Adapter/Mysqli/Result.php
     [line:protected] => 50
     [trace:Exception:private] => Array
         (
             [0] => Array
                 (
                     [function] => catchFatalError
                     [class] => Horde_ErrorHandler
                     [type] => ::
                     [args] => Array
                         (
                         )

                 )

         )

     [previous:Exception:private] =>
     [severity:protected] => 1
     [logged] => 1
)


Saved Queries