Bug #14307 Data type conversion error with output of 'show status'?
Submitted: 25 Oct 2005 22:23 Modified: 31 Oct 2005 8:31
Reporter: Daniel Kasak (Candidate Quality Contributor) Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:3.51.12 OS:Windows (Windows 2000)
Assigned to: CPU Architecture:Any

[25 Oct 2005 22:23] Daniel Kasak
Description:
The output of 'show status' or 'show status like ...' used to be accessible via ADO. Now I get records being returned, but the data is corrupted.

How to repeat:
Install MySQL-4.1.14 on server, and MyODBC-3.51.12 on client.

Run the following code from MS Access or plain VB:

---

Dim myconn As ADODB.connection, myset As ADODB.Recordset, statustxt As String

Set myconn = New ADODB.connection
With myconn
 .ConnectionString = MySQLconn
 .Open
End With

Set myset = New ADODB.Recordset
With myset
 .ActiveConnection = myconn
 .CursorLocation = adUseServer
 .CursorType = adOpenStatic
 .Open "show status like 'Connections'"
 statustxt = "MySQL stats:         Connections {" & myset("Value") & "}"
 .Close
 .Open "show status like 'Open_tables'"
 statustxt = statustxt & "   Open Tables {" & myset("Value") & "}"
 .Close
 .Open "show status like 'Questions'"
 statustxt = statustxt & "   Questions {" & myset("Value") & "}"
 .Close
 .Open "show status like 'Com_insert'"
 statustxt = statustxt & "   Inserts {" & myset("Value") & "}"
 .Close
End With

myconn.Close

Set myset = Nothing
Set myconn = Nothing

Debug.Print (statustxt)

---

Under 4.0.x and < 3.51.12, the above code used to work perfectly, and was used to update the status bar in Access with some stats on MySQL - it also doubled as a 'ping' to keep the ODBC connection alive and thus prevent Access from crashing :)

Under our current setup, I get strange box symbols, like an EOL character or something, instead of the relevant 'value'.

Suggested fix:
Beats me? Data type conversion? I'm no expert.
[26 Oct 2005 9:53] Vasily Kishkin
I was not able to reproduce the bug on VB. Results of VB:

MySQL stats:         Connections {17582}   Open Tables {0}   Questions {217897}   Inserts {200296}

Same queries in mysql:

mysql> show status like 'Connections';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Connections   | 17581 |
+---------------+-------+
1 row in set (0.08 sec)

mysql> show status like 'Open_Tables';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Open_tables   | 0     |
+---------------+-------+
1 row in set (0.00 sec)

mysql> show status like 'Questions';
+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| Questions     | 217901 |
+---------------+--------+
1 row in set (0.00 sec)

mysql> show status like 'Com_insert';
+---------------+--------+
| Variable_name | Value  |
+---------------+--------+
| Com_insert    | 200296 |
+---------------+--------+
1 row in set (0.00 sec)

Could you please build and run my test case on your computer ? My test case is attached.
[26 Oct 2005 9:53] Vasily Kishkin
Test case

Attachment: 14307.zip (application/x-zip-compressed, text), 5.31 KiB.

[26 Oct 2005 22:04] Daniel Kasak
Sorry. No can do - I don't have VB.

I probably shouldn't have said 'VB or Access', but the code I submitted was pure VB ( nothing Access specific ), so I assumed it would be the same. It at least displays the above behaviour under Access 2002.

I can attach an Access mdb file with a form that demonstrates the problem if you like, but it's basically a copy-paste of the code above into a form anyway.

Otherwise, if you can't reproduce it, then forget it - it's not particularly important for me.
[31 Oct 2005 8:31] Vasily Kishkin
I would like to notice It is not bug of MyODBC. Probably the problem is in Access 2002.
[31 Oct 2005 23:28] Daniel Kasak
???

We have been using Access 2002 for a number of years and only seen this bug introduced when we upgraded to MySQL-4.1.14 and MyODBC-3.51.12.

Are you sure?