Hi,

i found a segfault within fastbit. It seems to be related to in memory tables. 
It appears when you select with a where condition filtering on a text column. 

See attached code (data is still the same as in my previous testcase). Be sure 
to remove my comment in the code to make it really crash ;)

Kind regards,

        Andreas Streichardt
#include <ibis.h>
#include <iostream>

using namespace ibis;

void print_table_info(table *tab)
{
  std::cout << "Resultset: " << tab->nColumns() << "x" << tab->nRows() << std::endl;
}

int main()
{
  part  *partition=0;
  table *tab=0;
  table *in_memory_select=0;
  table *select_on_select=0;

  try
  {
    partition=new part("/tmp/test");
    if (!partition)
    {
      std::cout << "Couldn't create partition" << std::endl;
      goto cleanup;
    }

    tab=table::create(*partition);
    if (!tab)
    {
      std::cout << "Couldn't create tab" << std::endl;
      goto cleanup;
    }

    print_table_info(tab);
    in_memory_select=tab->select("uid,m_0000,m_yquit","1=1");

    if (!in_memory_select)
    {
      std::cout << "Couldn't create in memory select" << std::endl;
      goto cleanup;
    }
    
    print_table_info(in_memory_select);
    // crashes
    //select_on_select=in_memory_select->select("uid","m_yquit='1'");
    // works
    select_on_select=in_memory_select->select("uid","m_yquit=1");

    if (!select_on_select)
      std::cout << "Failure!" << std::endl;
    else
      print_table_info(select_on_select);
  }
  catch (const std::exception& e)
  {
    std::cout << "Got an exception: " << e.what() << std::endl;
  }
  catch (char *s)
  {
    std::cout << "Got a string exception: " << s << std::endl;
  }
  
  cleanup:
    if (select_on_select)
      delete select_on_select;
    if (in_memory_select)
      delete in_memory_select;
    if (tab)
      delete tab;
    if (partition)
      delete partition;
}
_______________________________________________
FastBit-users mailing list
[email protected]
https://hpcrdm.lbl.gov/cgi-bin/mailman/listinfo/fastbit-users

Reply via email to