Bug #31917 Microsoft Log Parser can't handle datatype TEXT
Submitted: 29 Oct 2007 15:02 Modified: 21 Jul 2009 7:09
Reporter: Susanne Ebrecht Email Updates:
Status: Not a Bug Impact on me:
None 
Category:Connector / ODBC Severity:S3 (Non-critical)
Version:5.1 OS:Microsoft Windows
Assigned to: CPU Architecture:Any
Tags: odbc_postga51

[29 Oct 2007 15:02] Susanne Ebrecht
Description:
Hi,

using Log Parser 2.2, MyODBC version 5.1, MySQL server version 5.1.22, Microsoft XP professioal

mysql> create table logparser(EventLog text);
Query OK, 0 rows affected (0.00 sec)

C:\PROGRA~1\LOGPAR~1.2>LogParser "select EventLog from system to logparser" -i:e
vt -o:sql -server:localhost -database:test -username:root -driver:"MySQL ODBC 5.
1 Driver"

Task aborted.
SQL table column "EventLog" data type is not compatible with SELECT clause item "EventLog" (type STRING)

mysql> drop table logparser;
Query OK, 0 rows affected (0.00 sec)

mysql> create table logparser(EventLog varchar(200));
Query OK, 0 rows affected (0.00 sec)

C:\PROGRA~1\LOGPAR~1.2>LogParser "select EventLog from system to logparser" -i:e
vt -o:sql -server:localhost -database:test -username:root -driver:"MySQL ODBC 5.
1 Driver"

Statistics:
-----------
Elements processed: 2305
Elements output:    2305
Execution time:     0.19 seconds

mysql> select distinct * from logparser;
+----------+
| EventLog |
+----------+
| System   |
+----------+

How to repeat:
mysql> create table logparser(EventLog text);
Query OK, 0 rows affected (0.00 sec)

C:\PROGRA~1\LOGPAR~1.2>LogParser "select EventLog from system to logparser" -i:e
vt -o:sql -server:localhost -database:test -username:root -driver:"MySQL ODBC 5.
1 Driver"

Task aborted.
SQL table column "EventLog" data type is not compatible with SELECT clause item "EventLog" (type STRING)
[21 Jul 2009 7:08] Tonci Grgin
Trace file for c/ODBC 5.1.5 64bit on W2k8x64

Attachment: SQLbug31917.zip (application/zip, text), 1.36 KiB.

[21 Jul 2009 7:09] Tonci Grgin
Susanne, judging from trace attached, I do not think this is a bug. My opinion is that LogParser is just not compatible with ODBC 3.0 API...
[21 Jul 2009 7:10] Tonci Grgin
Otherwise, the behavior is documented correctly, ie. I see same results as Susanne.
[21 Jul 2009 9:11] Tonci Grgin
Proper 32bit DM trace with VARCHAR(200)

Attachment: SQLbug31917-VC.zip (application/zip, text), 22.86 KiB.

[21 Jul 2009 9:21] Tonci Grgin
ODBCTE has no such problems:
select * from bug31917

SQLExecDirect:
	In:hstmt = 0x00000000006FDAA0, szSqlStr = "", cbSqlStr = -3
	Return:	SQL_SUCCESS=0

Get Data All:
"EventLog"
0 rows fetched from 1 column.

SQLColumns:
	In:StatementHandle = 0x00000000006FDAA0, CatalogName = "test", NameLength1 = 4, SchemaName = "test", NameLength2 = 4, TableName = "bug31917", NameLength3 = 8, ColumnName = "EventLog", NameLength4 = 8
	Return:	SQL_SUCCESS=0

Get Data All:
"TABLE_CAT", "TABLE_SCHEM", "TABLE_NAME", "COLUMN_NAME", "DATA_TYPE", "TYPE_NAME", "COLUMN_SIZE", "BUFFER_LENGTH", "DECIMAL_DIGITS", "NUM_PREC_RADIX", "NULLABLE", "REMARKS", "COLUMN_DEF", "SQL_DATA_TYPE", "SQL_DATETIME_SUB", "CHAR_OCTET_LENGTH", "ORDINAL_POSITION", "IS_NULLABLE"
"test", <Null>, "bug31917", "EventLog", -10, "text", 65535, 65535, <Null>, <Null>, 1, "", <Null>, -10, <Null>, 65535, 1, "YES"
1 row fetched from 18 columns.
[21 Jul 2009 9:22] Bogdan Degtyariov
Thanks Tonci for providing the traces.

The log that correspond to the error (with TEXT column) and the log with VARCHAR have no difference except the log with the error gracefully closes the connection and the LogParser reports about wrong data type. Thus, because ODBC calls are identical the problem must be with types in LogParser.

Verdict: not a bug