mytop error when using MySQL ANSI_QUOTES mode: Use of uninitialized value in string ne at /usr/bin/mytop line 1063.

Bug #1778745 reported by Michael Wood
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mytop (Debian)
mytop (Ubuntu)

Bug Description

I'm running MySQL with the following sql-mode in my.cnf:


By default MySQL treats single and double quotes interchangeably and uses backticks for escaping table/column names.
The "ANSI_QUOTES" option causes MySQL to use ANSI standard quoting (double quotes), so it no longer allows double quotes for string literals.

Line 1063 of mytop is:

        my($data) = Hashes('show global variables like "read_only"');

Attempting to execute that statement results in the following error from MySQL:

mysql> show global variables like "read_only";
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"read_only"' at line 1

Whereas using single quotes works as expected:

mysql> show global variables like 'read_only';
| Variable_name | Value |
| read_only | OFF |
1 row in set (0,00 sec)

When MySQL's sql-mode is set to include ANSI_QUOTES mytop spits out the following in the header:

Use of uninitialized value in string ne at /usr/bin/mytop line 1063.

Changing line 1063 to use single quotes in the SQL statement sent to MySQL resolves the problem.

Unfortunately the upstream project seems to be dead, so it seemed pointless trying to report it there.

ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: mytop 1.9.1-1 [modified: usr/bin/mytop]
ProcVersionSignature: Ubuntu 4.4.0-116.140~14.04.1-generic 4.4.98
Uname: Linux 4.4.0-116-generic x86_64
ApportVersion: 2.14.1-0ubuntu3.29
Architecture: amd64
CurrentDesktop: MATE
Date: Tue Jun 26 16:27:12 2018
InstallationDate: Installed on 2014-08-08 (1418 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Release amd64 (20140417)
PackageArchitecture: all
SourcePackage: mytop
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Michael Wood (mwood) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "Fix quoting" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in mytop (Debian):
status: Unknown → New
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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