Bug #20912 DatabaseMetaData.getTables hangs/memory leaks

Submitted: 8 Jul 2006 3:38 Modified: 12 Jul 2006 10:01
Reporter: George Van Treeck Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S1 (Critical)
Version:3.1.13 OS:Windows (Windows XP, SP 2)
Assigned to: CPU Architecture:Any
Tags: DatabaseMetaData, getTables

[8 Jul 2006 3:38] George Van Treeck
Description:
Trying to list tables on a non-default catalog causes a hang and memory leak. For example, when the default catalog is "inventory" (specified in the URL for creating the connection): 

getTables("orders", null, "%", tableTypes) hangs and memory usage starts to grow very large... 

Also, 
getTables("orders", null, "shipto", tableTypes) hangs and memory usage starts to grow... 

The "orders" catalog and "shipto" table both exist.

As a work-around, I tried to pass null as the catalog and just pick out those tables with a matching catalog name. But, instead of listing all tables for all catalogs, it only lists tables in the default catalog (another bug). Thus, there is no work-around to get a listing of tables outside the default catalog.

This is critical issue because most large applications access across catalogs. For example, data in "accounts" recievables/payables might be updated when  "orders" or "inventory" are updated.

I was using Connector/J 3.1.3 with MySQL 5.0.

How to repeat:
Into some existing program you already have, insert a statement that calls getTables specifying a non-default catalog name and use a wild card ("%") for the table name parameter.
[12 Jul 2006 9:57] Tonci Grgin
Test case

Attachment: Main.java (text/x-java), 2.57 KiB.

[12 Jul 2006 10:01] Tonci Grgin
Hi George, thanks for your problem report. I was unable to verify it with test case attached. There might be some problems with your server settings / privileges causing reported behavior.

Environment:
  MySQL server 5.0.24BK on Suse 10
  WinXP SP2 client with mysql-connector-java-3.1.13 GA and JDK 1.6

Test output:
init:
deps-jar:
Compiling 1 source file to C:\Documents and Settings\Tonci\TestB20912-13\build\classes
compile:
run:
Connected

Testing default schema, schema not-null (mysql)
  Schema: mysql
    ROW: 1 Table: columns_priv
    ROW: 2 Table: db
    ROW: 3 Table: func
    ROW: 4 Table: help_category
    ROW: 5 Table: help_keyword
    ROW: 6 Table: help_relation
    ROW: 7 Table: help_topic
    ROW: 8 Table: host
    ROW: 9 Table: proc
    ROW: 10 Table: procs_priv
    ROW: 11 Table: tables_priv
    ROW: 12 Table: time_zone
    ROW: 13 Table: time_zone_leap_second
    ROW: 14 Table: time_zone_name
    ROW: 15 Table: time_zone_transition
    ROW: 16 Table: time_zone_transition_type
    ROW: 17 Table: user
    ROW: 18 Table: user_info

Testing default schema, schema null (mysql)
  Schema: mysql
    ROW: 1 Table: columns_priv
    ROW: 2 Table: db
    ROW: 3 Table: func
    ROW: 4 Table: help_category
    ROW: 5 Table: help_keyword
    ROW: 6 Table: help_relation
    ROW: 7 Table: help_topic
    ROW: 8 Table: host
    ROW: 9 Table: proc
    ROW: 10 Table: procs_priv
    ROW: 11 Table: tables_priv
    ROW: 12 Table: time_zone
    ROW: 13 Table: time_zone_leap_second
    ROW: 14 Table: time_zone_name
    ROW: 15 Table: time_zone_transition
    ROW: 16 Table: time_zone_transition_type
    ROW: 17 Table: user
    ROW: 18 Table: user_info

Testing not-default schema, schema not-null (test)
  Schema: test
    ROW: 1 Table: TESTBINARY
    ROW: 2 Table: TESTBINDPARAM
    ROW: 3 Table: TESTSTREAM
    ROW: 4 Table: TestTest
    ROW: 5 Table: da
    ROW: 6 Table: deps
    ROW: 7 Table: lpsfrtinv
    ROW: 8 Table: master
    ROW: 9 Table: packages
    ROW: 10 Table: people
    ROW: 11 Table: releases
    ROW: 12 Table: reserved
    ROW: 13 Table: slave
    ROW: 14 Table: tblTransactions
    ROW: 15 Table: test
    ROW: 16 Table: test1
    ROW: 17 Table: test11
    ROW: 18 Table: test_bind_fetch
    ROW: 19 Table: test_table
    ROW: 20 Table: testtable
    ROW: 21 Table: tst20306
    ROW: 22 Table: tstidx

Testing default schema, schema not-null (mysql), pattern 'time%'
  Schema: mysql
    ROW: 1 Table: time_zone
    ROW: 2 Table: time_zone_leap_second
    ROW: 3 Table: time_zone_name
    ROW: 4 Table: time_zone_transition
    ROW: 5 Table: time_zone_transition_type

Testing not-default schema, schema not-null (test), pattern 'TEST%'
  Schema: test
    ROW: 1 Table: TESTBINARY
    ROW: 2 Table: TESTBINDPARAM
    ROW: 3 Table: TESTSTREAM

BUILD SUCCESSFUL (total time: 0 seconds)

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.052 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.