Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

found a bug with example.c using "./db" instead of memory #17

Closed
sprappcom opened this issue Sep 16, 2024 · 4 comments
Closed

found a bug with example.c using "./db" instead of memory #17

sprappcom opened this issue Sep 16, 2024 · 4 comments

Comments

@sprappcom
Copy link

Describe the bug
in example.c, replace with

#include <crossdb.h>

int main (int argc, char **argv)
{
        xdb_res_t       *pRes;
        xdb_row_t       *pRow;

        xdb_conn_t      *pConn = xdb_open ("./db");

        // Create Table
        pRes = xdb_exec (pConn, "CREATE TABLE IF NOT EXISTS student (id INT PRIMARY KEY, name CHAR(16), age INT, class CHAR(16), score FLOAT, info CHAR(255))");

full code here:
https://pastebin.com/d6U8jFkp

To Reproduce
run
make example

then
exit and type
./example

crash with error below:

./example 
[XDB Error] 9: 'CREATE TABLE student (  id               INT,  name             CHAR(16),  age              INT,  class            CHAR(16),  score            FLOAT,  info             CHAR(255),  PRIMARY KEY (id) XOID=0) XOID=0' ERROR 1 : Failed to create table 'student'
[XDB Error] 17: 'CREATE TABLE teacher (  id               INT,  name             CHAR(16),  age              INT,  info             CHAR(255),  PRIMARY KEY (id) XOID=0,  KEY         name_2 (name) XOID=1) XOID=1' ERROR 1 : Failed to create table 'teacher'
Segmentation fault (core dumped)

Expected behavior
doesnt work as expected with on disk.

Desktop (please complete the following information):

  • OS: ubuntu 24.04
  • Version latest

Additional context
on disk example cannot be ran twice.

@jcwangxp
Copy link
Member

Please retest with 0.8.0
#15

@sprappcom
Copy link
Author

sprappcom commented Sep 18, 2024 via email

@sprappcom
Copy link
Author

sprappcom commented Sep 18, 2024 via email

@sprappcom
Copy link
Author

sprappcom commented Sep 18, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants