Public bug reported:

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

sql-mode = "STRICT_TRANS_TABLES,ANSI_QUOTES,NO_ENGINE_SUBSTITUTION"

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.
 ReadOnly

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)

** Affects: mytop (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug

** Patch added: "Fix quoting"
   https://bugs.launchpad.net/bugs/1778745/+attachment/5156788/+files/mytop.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1778745

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mytop/+bug/1778745/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to