crossdb-org / crossdb

Ultra High-performance Lightweight Embedded and Server OLTP RDBMS✨
https://crossdb.org
Mozilla Public License 2.0
163 stars 8 forks source link

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

Closed sprappcom closed 3 weeks ago

sprappcom commented 3 weeks ago

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):

Additional context on disk example cannot be ran twice.

jcwangxp commented 3 weeks ago

Please retest with 0.8.0 https://github.com/crossdb-org/crossdb/issues/15

sprappcom commented 3 weeks ago

ok thx for the prompt reply.

now cannot do make example as in the github issue.

On Wed, Sep 18, 2024 at 3:01 AM JC Wang @.***> wrote:

Please retest with 0.8.0

15 https://github.com/crossdb-org/crossdb/issues/15

— Reply to this email directly, view it on GitHub https://github.com/crossdb-org/crossdb/issues/17#issuecomment-2357661250, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFM3SPP4ZVF6NZHOTNIC7RDZXEQMPAVCNFSM6AAAAABOKJ75ISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJXGY3DCMRVGA . You are receiving this because you authored the thread.Message ID: @.***>

sprappcom commented 3 weeks ago

i fixed it somehow. thx

On Wed, Sep 18, 2024 at 5:55 AM Kolin Fluence @.***> wrote:

ok thx for the prompt reply.

now cannot do make example as in the github issue.

On Wed, Sep 18, 2024 at 3:01 AM JC Wang @.***> wrote:

Please retest with 0.8.0

15 https://github.com/crossdb-org/crossdb/issues/15

— Reply to this email directly, view it on GitHub https://github.com/crossdb-org/crossdb/issues/17#issuecomment-2357661250, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFM3SPP4ZVF6NZHOTNIC7RDZXEQMPAVCNFSM6AAAAABOKJ75ISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJXGY3DCMRVGA . You are receiving this because you authored the thread.Message ID: @.***>

sprappcom commented 3 weeks ago

also tested, the golang i've sent previously works now. how do u suggest i provide the golang binding repo?

can u make one repo so i can add to it as officially endorsed by you etc?

On Wed, Sep 18, 2024 at 6:12 AM Kolin Fluence @.***> wrote:

i fixed it somehow. thx

On Wed, Sep 18, 2024 at 5:55 AM Kolin Fluence @.***> wrote:

ok thx for the prompt reply.

now cannot do make example as in the github issue.

On Wed, Sep 18, 2024 at 3:01 AM JC Wang @.***> wrote:

Please retest with 0.8.0

15 https://github.com/crossdb-org/crossdb/issues/15

— Reply to this email directly, view it on GitHub https://github.com/crossdb-org/crossdb/issues/17#issuecomment-2357661250, or unsubscribe https://github.com/notifications/unsubscribe-auth/BFM3SPP4ZVF6NZHOTNIC7RDZXEQMPAVCNFSM6AAAAABOKJ75ISVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJXGY3DCMRVGA . You are receiving this because you authored the thread.Message ID: @.***>