6.0.0-beta1
7/10/25

[#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 01/06/2016 (3473 days ago)
Due
Updated 10/20/2017 (2820 days ago)
Assigned 01/06/2016 (3473 days ago)
Resolved 01/06/2016 (3473 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
10/20/2017 08:33:43 PM 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
01/06/2016 06:39:18 PM Michael Rubinsky State ⇒ Resolved
 
01/06/2016 06:38:56 PM 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
01/06/2016 06:36:39 PM 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
01/06/2016 06:23:52 PM 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.
01/06/2016 05:49:48 PM Michael Rubinsky Comment #2
State ⇒ Assigned
Assigned to Michael Rubinsky
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.


01/06/2016 05:30:46 PM 3rdpartybugs (at) object (dot) earth Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ /admin/sqlshell.php fails on UPDATE query: Call to a member function fetch_array() on boolean
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
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