[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#903113: marked as done (mytop error when using MySQL ANSI_QUOTES mode: Use of uninitialized value in string ne at /usr/bin/mytop line 1063.)



Your message dated Tue, 20 Dec 2022 15:58:19 +0000
with message-id <[🔎] E1p7f0V-004YvI-EP@fasolo.debian.org>
and subject line Bug#1026428: Removed package(s) from unstable
has caused the Debian Bug report #903113,
regarding mytop error when using MySQL ANSI_QUOTES mode: Use of uninitialized value in string ne at /usr/bin/mytop line 1063.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
903113: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903113
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: mytop
Version: 1.9.1-4

Perl version: 5.18.2-2ubuntu1.6

I encountered this bug in the Ubuntu package and reported it here:
https://bugs.launchpad.net/bugs/1778745

I have verified that the problem also exists in Debian unstable.

Output when run on a system with sql-mode including ANSI_QUOTES:

MySQL on localhost (5.6.33)        load 0.39 0.54 0.58 2/1749 31690 up
124+10:33:39 [10:20:13]
 Queries: 6.7M     qps:    1 Slow:   107.0         Se/In/Up/De(%):
87/00/11/00
 Sorts:      0 qps now:    1 Slow qps: 0.0  Threads:    3 (   1/   3)
00/00/00/00
 Key Efficiency: 99.9%  Bps in/out: 274.6/205.3   Now in/out:  22.6/ 2.4k
Use of uninitialized value in string ne at /usr/bin/mytop line 1063.
 ReadOnly
       Id      User         Host/IP         DB       Time    Cmd    State Query
       --      ----         -------         --       ----    ---
----- ----------
     1007      root       localhost                     0  Query     init show f

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.

The fix is just to swap the single quotes to double quotes in that
line, and vice versa as in the attached patch.

-- 
Michael Wood <esiotrot@gmail.com>
Description: fix quoting when in ANSI_QUOTES mode
Author: Michael Wood <esiotrot@gmail.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1778745
--- a/mytop
+++ b/mytop
@@ -1059,7 +1059,7 @@ sub GetData()
 
         $lines_left--;
 
-        my($read_only) = Hashes('show global variables like "read_only"');
+        my($read_only) = Hashes("show global variables like 'read_only'");
         if ($read_only->{Value} ne "OFF")
         {
             print RED() if ($HAS_COLOR) ;

--- End Message ---
--- Begin Message ---
Version: 1.9.1-5+rm

Dear submitter,

as the package mytop has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1026428

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Scott Kitterman (the ftpmaster behind the curtain)

--- End Message ---

Reply to: