Warning in ./libraries/sql.lib.php shown, when any table contents are listed

Bug #1852536 reported by Kalle Tuulos
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
phpmyadmin (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

1) The release of Ubuntu you are using, via 'lsb_release -rd' or System -> About Ubuntu
Ubuntu 16.04.6 LTS

2) The version of the package you are using, via 'apt-cache policy pkgname' or by checking in Software Center

phpmyadmin:
  Installed: 4:4.5.4.1-2ubuntu2.1
  Candidate: 4:4.5.4.1-2ubuntu2.1
  Version table:
 *** 4:4.5.4.1-2ubuntu2.1 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages
        500 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages
        100 /var/lib/dpkg/status
     4:4.5.4.1-2ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu xenial/universe amd64 Packages

3) What you expected to happen

Any table is opened from any database. The rows from table should be listed on PHPMyadmin display.

4) What happened instead

An error pop-up appears: "Some errors have been detected on the server! Please look at the bottom of this window." (Ignore All) (Ignore)

The detailed error is:

Warning in ./libraries/sql.lib.php#601
 count(): Parameter must be an array or an object that implements Countable

Backtrace

./libraries/sql.lib.php#2038: PMA_isRememberSortingOrder(array)
./libraries/sql.lib.php#1984: PMA_executeQueryAndGetQueryResponse(
array,
boolean true,
string 'mailserver',
string 'virtual_aliases',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `virtual_aliases`',
NULL,
NULL,
)
./sql.php#216: PMA_executeQueryAndSendQueryResponse(
array,
boolean true,
string 'mailserver',
string 'virtual_aliases',
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
string '',
string './themes/pmahomme/img/',
NULL,
NULL,
NULL,
string 'SELECT * FROM `virtual_aliases`',
NULL,
NULL,
)

This error can be corrected by editing file /usr/share/phpmyadmin/libraries/sql.lib.php as follows:

line 601:
Replace || count($analyzed_sql_results['select_expr'] == 1)
With || (count($analyzed_sql_results['select_expr']) == 1)

line 602:
Replace && ($analyzed_sql_results['select_expr'][0] == '*')))
With && ($analyzed_sql_results['select_expr'][0] == '*'))

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: phpmyadmin 4:4.5.4.1-2ubuntu2.1
Uname: Linux 2.6.32-042stab140.1 x86_64
ApportVersion: 2.20.1-0ubuntu2.21
Architecture: amd64
Date: Thu Nov 14 08:34:19 2019
PackageArchitecture: all
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 SHELL=/bin/bash
SourcePackage: phpmyadmin
UpgradeStatus: No upgrade log present (probably fresh install)
mtime.conffile..etc.phpmyadmin.apache.conf: 2019-09-15T12:07:25.653028

Revision history for this message
Kalle Tuulos (kalle-tuulos) wrote :
Revision history for this message
William Desportes (williamdes) wrote :

Hello,

You can have a look at https://github.com/phpmyadmin/phpmyadmin/issues/15515#issuecomment-552211446 and install using our PPA:

sudo add-apt-repository ppa:phpmyadmin/ppa
sudo apt-get update
sudo apt-get install phpmyadmin

Changed in phpmyadmin (Ubuntu):
status: New → Fix Released
Revision history for this message
Kalle Tuulos (kalle-tuulos) wrote :

Should this be still fixed in 16.04's normal repository?

Revision history for this message
Kalle Tuulos (kalle-tuulos) wrote :

This is because:

kalle@hostname:~$ sudo add-apt-repository ppa:phpmyadmin/ppa
 Test packages for Ubuntu, maintained on salsa.debian.org/phpmyadmin-team

Do not use these packages on production! Wait until they are released through the official ubuntu-channels.
 More info: https://launchpad.net/~phpmyadmin/+archive/ubuntu/ppa
Press [ENTER] to continue or ctrl-c to cancel adding it

Changed in phpmyadmin (Ubuntu):
status: Fix Released → New
Revision history for this message
Kalle Tuulos (kalle-tuulos) wrote :

Also, the ppa:phpmyadmin/ppa does not offer support for xenial. Only for bionic and eon. Please see below:

sudo apt-get update
...
Reading package lists... Done
W: The repository 'http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://ppa.launchpad.net/phpmyadmin/ppa/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found

Revision history for this message
Giovanni Panozzo (giox069) wrote :

Same problem for the fresh install of phpmyadmin under Ubuntu 18.04.3 LTS bionic.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in phpmyadmin (Ubuntu):
status: New → Confirmed
Revision history for this message
Gerben Vos (gpvos) wrote :

This has apparently just been fixed in Debian, can we copy their fixes? See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879741 .

Revision history for this message
William Desportes (williamdes) wrote :

Hello,

The diff between 4.5 and 4.9 make an import very difficult.
I do not not if importing patches is "allowed"
And
Next version of phpMyAdmin will be available soon on Ubuntu

The issue on our tracker: https://github.com/phpmyadmin/phpmyadmin/issues/13938
The commit to fix it: https://github.com/phpmyadmin/phpmyadmin/commit/4ef752efb37b2de3ba2349590201d55533ad074b
The patch URL: https://github.com/phpmyadmin/phpmyadmin/commit/4ef752efb37b2de3ba2349590201d55533ad074b.patch

You can patch your local setup while waiting for the 4.9 version to be available if you can not use our PPA

Regards,
William Desportes

Changed in phpmyadmin (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.