Bug #19500 getColumnPrivilege on a table where all columns have privilege gives coredump
Submitted: 3 May 2006 6:17 Modified: 29 May 2013 11:25
Reporter: Vivek Singh Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S1 (Critical)
Version:3.51 OS:Windows (Windows)
Assigned to: CPU Architecture:Any

[3 May 2006 6:17] Vivek Singh
Description:
calling java function getColumnPrivileges() from DatabaseMetadata class is very inconsistent.
Sometimes it gives right result and most of time gives coredump. There is no consistency in the output ResultSet
If table and All the columns have privilege it gives core dump. If there is atleast one column which does not have  privilege it gives right result.

java dump is :
#
# An unexpected error has been detected by HotSpot Virtual Machine:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c911e58, pid=3888, tid=3588
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode, sharing)
# Problematic frame:
# C  [ntdll.dll+0x11e58]
#

---------------  T H R E A D  ---------------

Current thread (0x00aaca90):  JavaThread "AWT-EventQueue-0" [_thread_in_native,
id=3588]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000000

Registers:
EAX=0x037e3188, EBX=0x036e0000, ECX=0x00000000, EDX=0x00000000
ESP=0x031ff1ec, EBP=0x031ff1f8, ESI=0x037e3180, EDI=0x037e4d70
EIP=0x7c911e58, EFLAGS=0x00010246

Top of Stack: (sp=0x031ff1ec)
0x031ff1ec:   036e0000 037e4d70 00000000 031ff2cc
0x031ff1fc:   7c910d5c 00000000 037e4d70 031ff2b0
0x031ff20c:   00000000 037e4d78 037e4d78 037e4d70
0x031ff21c:   00000000 2720656b 037e4d78 6320444e
0x031ff22c:   0000000a 6e5f656c 00000000 61542e74
0x031ff23c:   5f656c62 656d616e 44524f20 037e4d70
0x031ff24c:   036e0168 00000000 00000000 037e4d70
0x031ff25c:   00000000 037e4d78 6e6d756c 036e0178

Instructions: (pc=0x7c911e58)
0x7c911e48:   85 97 7a 03 00 8b 4e 0c 8d 46 08 8b 10 89 4d 08
0x7c911e58:   8b 09 3b 4a 04 89 55 0c 0f 85 9d 00 00 00 3b c8

Stack: [0x031c0000,0x03200000),  sp=0x031ff1ec,  free space=252k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [ntdll.dll+0x11e58]
C  [ntdll.dll+0x10d5c]
C  [myodbc3.dll+0x4db5d]
C  [myodbc3.dll+0x20e6]
C  [myodbc3.dll+0x25e0]
C  [ODBC32.dll+0x2b471]
C  [ODBC32.dll+0x30bf5]
C  [ODBC32.dll+0x3214f]
C  [JdbcOdbc.dll+0x4aeb]
j  sun.jdbc.odbc.JdbcOdbc.columnPrivileges(J[BZ[BZ[BZ[BZ[B)V+0
j  sun.jdbc.odbc.JdbcOdbc.SQLColumnPrivileges(JLjava/lang/String;Ljava/lang/Stri
ng;Ljava/lang/String;Ljava/lang/String;)V+273
j  sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getColumnPrivileges(Ljava/lang/String;
Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/sql/ResultSet;+106
j  DBInfoListener.actionPerformed(Ljava/awt/event/ActionEvent;)V+5597
j  javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V
+84
j  javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEven

How to repeat:
Use Jdbc:Odbc bridge.
Call getColumnPrivilege function on tables which has columns with all privilege.
It should give core dump.
[3 May 2006 13:10] Mark Matthews
Why aren't you using our Type-4 JDBC driver? Even Sun says you shouldn't use the JDBC:ODBC bridge in production, and certainly not if there's an actual JDBC driver available for the database.
[14 Jun 2006 11:22] Tonci Grgin
Vivek, Can you please do as Mark suggested and post the result of test that is not using JDBC/ODBC bridge?
[15 Jun 2006 8:29] Vivek Singh
I did try with Jconnector 3.1 
getColumnPrivilege is not giving coredump but it is not showing column privilege  also.

While testing another openSouce data quality product at http://www.arrah.in I found if I try to get parameter info it gives null pointer exception while it worked as expected with jdbc:odbc bridge

here is the outcome 

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
        at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:3587)
        at DBInfoListener.actionPerformed(DBInfoListener.java:553) (Local Code)

regards,
Vivek
[26 Jun 2006 8:49] Tonci Grgin
Vivek, can you post small java project and a dump with table structures and some data showing this error?
[26 Jul 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[29 May 2013 11:25] Bogdan Degtyariov
I'm closing this bug because I can not continue without feedback from the reporter. If you have new info, please reopen the report.