Berkeley DB C++ (if record exceeds 255 in table then it does not sort)

View: New views
1 Messages — Rating Filter:   Alert me  

Berkeley DB C++ (if record exceeds 255 in table then it does not sort)

by Ali Muhammad kaim khani :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Hi , All
My system specs: are
fc4 , linux Berkeley, gnu C/C++, DB 4.3.27
My problem is , I am inserting key/data (records) pairs in table, upto 255 record the sorting is well (that sorted with respect to key (ascending )) , but if I insert 256th record then Berkeley DB does not sort the table in key ascending order. The key in this is of type "int" and data is "char * ".
One of my record look like is:

key = 175 ,  data = MESSAGE|SENTITEMS|Ali Muhammad|03343450746|I am fine here, what about   you |06/05/2007|16:55:45|33600

My database open call is as under

        if((ret = db_create(&databasePointer, NULL, 0)) != 0)
        {
                fprintf(stderr, "db_create: %s\n", db_strerror(ret));
          exit (1);
        }
       
        if((ret = databasePointer->open(databasePointer, NULL, databaseName, NULL, DB_BTREE, DB_CREATE, 0664))!= 0)
        {
                databasePointer->err(databasePointer, ret, "%s", databaseName);
        }

Any help would be appriciated
Thanks,
Ali Muhammad Kaim Khani
LightInTheBox - Buy quality products at wholesale price