Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5343

ConnectSE: ODBC: CATFUNC=Tables and CATFUNC=Columns crash when running against a data source with many tables

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • None
    • None
    • None
    • None

    Description

      mysql> drop table if exists t1; create table t1 (a varchar(10)) engine=connect table_type=odbc connection='DSN=oraodbc;UID=system;PWD=manager' catfunc=Columns; select * from t1;
      Query OK, 0 rows affected (0.00 sec)
      Query OK, 0 rows affected (0.10 sec)
      ERROR 2013 (HY000): Lost connection to MySQL server during query

      This is a stack trace:

      #0  0x0000000000c94792 in VALUE::GetType (this=0x0)
          at /home/bar/maria-bzr/maria-10.0-connect/storage/connect/value.h:88
      #1  0x0000000000ccb8b4 in VALBLK::ChkTyp (this=0x7fffaf0005a0, v=0x0)
          at /home/bar/maria-bzr/maria-10.0-connect/storage/connect/valblk.cpp:177
      #2  0x0000000000ccc01c in CHRBLK::SetValue (this=0x7fffaf0005a0, valp=0x0, n=751)
          at /home/bar/maria-bzr/maria-10.0-connect/storage/connect/valblk.cpp:559
      #3  0x0000000000d065c5 in ODBConn::GetCatInfo (this=0x7fffaf0002c8, cap=0x7fffaf05ede8)
          at /home/bar/maria-bzr/maria-10.0-connect/storage/connect/odbconn.cpp:2136
      #4  0x0000000000d024dd in ODBCColumns (g=0x7fffb4507000, 
          dsn=0x7fffaf0001d0 "DSN=oraodbc;UID=system;PWD=manager", table=0x0, colpat=0x0, info=false)
          at /home/bar/maria-bzr/maria-10.0-connect/storage/connect/odbconn.cpp:332
      ...

      The crash happens because pval[i] is NULL at this point:

      (gdb) frame 3
      #3  0x0000000000d065c5 in ODBConn::GetCatInfo (this=0x7fffaf0002c8, cap=0x7fffaf05ede8)
          at /home/bar/maria-bzr/maria-10.0-connect/storage/connect/odbconn.cpp:2136
      2136	            crp->Kdata->SetValue(pval[i], n);
      (gdb) p pval[i]
      $1 = (PVAL) 0x0
      (gdb) p i
      $2 = 0

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.