FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Access Violation when using row['name'] with 1.012 or 1.013

 
Post new topic   Reply to topic     Forum Index -> DDBI
View previous topic :: View next topic  
Author Message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Sat Apr 21, 2007 10:29 pm    Post subject: Access Violation when using row['name'] with 1.012 or 1.013 Reply with quote

Greetings.

I am using the SQLite ddbi libraries and though I keep getting this bogus error messages, I am working somewhat ok. However, after updating my dmd version from 1.010 to 1.013 and I am getting access violation when using row['colname']. This same procedure
Code:
  char[][] Row2CharArray(Row r)
  {
    SQLCols = std.string.split("id login cust proj bdate edate pm lang vendor notes status");
    char[][] dd;
    foreach (char[] field; SQLCols)
    {
      dd.length = dd.length + 1;
      dd [dd.length - 1] = r[field];
    }
    return dd;
  }

works with dmd 1.010, but it does not work with 1.012 nor with 1.013.

Any ideas?

thanks,

jic
Back to top
View user's profile Send private message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Tue Apr 24, 2007 12:04 am    Post subject: Reply with quote

Is anyone else using SQLite with the DDBI libraries or am I the only one?
Back to top
View user's profile Send private message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Tue Apr 24, 2007 8:32 am    Post subject: Reply with quote

The only one? That's quite possible. I know that at least I'm not. Smile

If you get a working binary out of DMD 1.010, but not anything newer, then it's very likely a codegen bug, and not a problem with SQLite. Is there anything on DMD's bugzilla that matches what you're seeing?
_________________
-- !Eric.t.Anderton at gmail
Back to top
View user's profile Send private message Yahoo Messenger
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Tue Apr 24, 2007 10:04 am    Post subject: Reply with quote

pragma wrote:
The only one? That's quite possible. I know that at least I'm not. Smile


je je je je... That's a Spanish sarcastic laugh. Smile As you know, the j in Spanish is like an h. Smile

pragma wrote:
If you get a working binary out of DMD 1.010, but not anything newer, then it's very likely a codegen bug, and not a problem with SQLite. Is there anything on DMD's bugzilla that matches what you're seeing?

I have not gone there in a while. No time, but I'll visit also. I also upgraded my SQLite DLL to 3.3.13, which was the last one on the code, but that also did not fixed the problem.
Back to top
View user's profile Send private message
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Tue Apr 24, 2007 10:11 am    Post subject: Reply with quote

One more question, are you able to use the row["colname"] with any other DDBI library as in MySQL, etc? I believe the Row library has the same source code for all libraries (MySQL, SQLite, etc.), correct?
Back to top
View user's profile Send private message
pragma



Joined: 28 May 2004
Posts: 607
Location: Washington, DC

PostPosted: Wed Apr 25, 2007 8:02 am    Post subject: Reply with quote

jicman wrote:
One more question, are you able to use the row["colname"] with any other DDBI library as in MySQL, etc? I believe the Row library has the same source code for all libraries (MySQL, SQLite, etc.), correct?


I've only used DBBI with Postgresql, and it works very well.
_________________
-- !Eric.t.Anderton at gmail
Back to top
View user's profile Send private message Yahoo Messenger
jicman



Joined: 22 Dec 2004
Posts: 298
Location: Rochester, NY

PostPosted: Wed Apr 25, 2007 11:51 pm    Post subject: Reply with quote

So, to update this post, I created this small program,
Code:
import std.stdio;
import dbi.sqlite.SqliteDatabase;
import dbi.Row;

void main()
{
    SqliteDatabase db = new SqliteDatabase();
    db.connect("test.db");

      db.execute("CREATE TABLE Names ( id primary key, name );");
      //add sample data
      db.execute("INSERT INTO Names values( 'jic','jose');");
      db.execute("INSERT INTO Names values( 'bah','pedro');");

    Row[] rows = db.queryFetchAll("SELECT * FROM Names");
    foreach (Row row; rows) {
        writefln("name:" ~ row["name"] ~ "\n");
    }

    db.close();

}

and I compiled it with 1.013 and it worked. Then I tried my other program, and it worked. I really can tell you what happened, but maybe, compiling this small program cleaned some cache bad something. Dunno. But anyway, I am able to compile my program again with 1.013.

thanks,

jose
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DDBI All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group