[MCOL-1451] getColumnCount() returns 0 Created: 2018-05-31  Updated: 2023-10-26  Resolved: 2023-10-25

Status: Closed
Project: MariaDB ColumnStore
Component/s: None
Affects Version/s: 1.1.4
Fix Version/s: Icebox

Type: Bug Priority: Critical
Reporter: Anders Karlsson Assignee: Leonid Fedorov
Resolution: Won't Fix Votes: 0
Labels: None
Environment:

Linux CentOS 7.2



 Description   

The mcsapi::ColumnStoreBulkInsert member funtion getColumnCount() always returns 0.

#include <libmcsapi/mcsapi.h>
#include <iostream>
 
int main(int argc, char *argv[])
   {
   mcsapi::ColumnStoreDriver* driver = nullptr;
   mcsapi::ColumnStoreBulkInsert* bulk = nullptr;
 
   try {
      driver = new mcsapi::ColumnStoreDriver();
      bulk = driver->createBulkInsert("test", "t1", 0, 0);
      std::cout << "Num cols: " << bulk->getColumnCount() << std::endl;
   } catch (mcsapi::ColumnStoreError &e) {
      std::cout << "Error caught: " << e.what() << std::endl;
   }
   delete bulk;
   delete driver;
 
   return 0;
   }

g++ `pkg-config libmcsapi --cflags` -std=c++11 bug.cpp `pkg-config libmcsapi --libs` -o bug

Assuming a table test.t1 with 1 column, running this program:

$ ./bug
Num cols: 0



 Comments   
Comment by Jens Röwekamp (Inactive) [ 2018-06-28 ]

As a workaround please use the getColumnCount() function of ColumnStoreSystemCatalogTable.

Generated at Thu Feb 08 02:28:51 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.