Skip to content

C++ SQLite fails for CLAS12 RCDB, since it lacks table files_have_runs #122

@c-dilks

Description

@c-dilks

The simple.cpp example from the C++ API documentation fails for the CLAS12 RCDB sqlite file,

sqlite:////u/scigroup/cvmfs/hallb/clas12/sw/noarch/data/rcdb/rcdb_dev.sqlite

Following the example, here is a reproducer and its output, where $RCDB_CONNECTION points to that SQLite file:

#!/usr/bin/env bash
set -euo pipefail
echo $RCDB_CONNECTION
gcc $RCDB_HOME/cpp/examples/simple.cpp \
  -o simple-sqlite \
  -I$RCDB_HOME/cpp/include/ \
  -std=c++11 \
  -lstdc++ \
  -lsqlite3 \
  -DRCDB_SQLITE
./simple-sqlite $RCDB_CONNECTION 6666

output:

sqlite:////u/scigroup/cvmfs/hallb/clas12/sw/noarch/data/rcdb/rcdb_dev.sqlite
terminate called after throwing an instance of 'SQLite::Exception'
  what():  no such table: files_have_runs

By comparison, the MariaDB (MySQL) test works fine:

#!/usr/bin/env bash
set -euo pipefail
echo $RCDB_CONNECTION
gcc $RCDB_HOME/cpp/examples/simple.cpp \
  -o simple-mariadb \
  -I$RCDB_HOME/cpp/include/ \
  -std=c++11 \
  -lstdc++ \
  -DRCDB_MYSQL \
  $(mariadb_config --libs --cflags --include)
./simple-mariadb $RCDB_CONNECTION 6666

output:

mysql://rcdb@clasdb-farm.jlab.org/rcdb
event_count is: 68152665

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions