May 18, 2013 Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Sat, 18 May 2013 14:30:13 -0400 Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > On Sat, 18 May 2013 17:42:24 +0200 > "Gary Willoughby" <dev@kalekold.net> wrote: > > > Hi, i've tried using this library for a simple query and i run into an error. I wondered if this is a bug in the connection code. > > > > Hmm, I'll look into it... The problem is triggered by retrieving a TIMESTAMP value (although DATETIME works fine). I've filed the issue here: https://github.com/rejectedsoftware/mysql-native/issues/9 I'm still looking into it. |
May 19, 2013 Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Sat, 18 May 2013 15:11:24 -0400 Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > On Sat, 18 May 2013 14:30:13 -0400 > Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > > > On Sat, 18 May 2013 17:42:24 +0200 > > "Gary Willoughby" <dev@kalekold.net> wrote: > > > > > Hi, i've tried using this library for a simple query and i run into an error. I wondered if this is a bug in the connection code. > > > > > > > Hmm, I'll look into it... > > The problem is triggered by retrieving a TIMESTAMP value (although DATETIME works fine). I've filed the issue here: > > https://github.com/rejectedsoftware/mysql-native/issues/9 > > I'm still looking into it. > Fixed. Removing the assert turned out to be the correct solution after all. The assert was based on a faulty assumption, and none of the code actually relied on the assertion passing (see the ticket above for more detailed info). |
May 19, 2013 Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | > Fixed. > > Removing the assert turned out to be the correct solution after all. > The assert was based on a faulty assumption, and none of the code > actually relied on the assertion passing (see the ticket above for more > detailed info). Great, thanks Nick. I have however found a few other issues. Using this code: auto connection = new Connection(MySQLSocketType.phobos, "127.0.0.1", "root", "r00t", "Project"); auto command = new Command(connection, "INSERT INTO tblUser (name, age) VALUES (?, ?)"); command.prepare(); ulong rowsAffected; string name; foreach (int age; 0..100000) { name = "Test User"; command.bindParameter(name, 0); command.bindParameter(age, 1); command.execPrepared(rowsAffected); } Raises two simple to fix errors in the connection code. 1). mysql/connection.d(3845): Error: more initializers than fields (5) of ParameterSpecialization Basically the initialisation of the structure contains too many parameters. 2). mysql/connection.d(3858): Error: no property 'dummy' for type 'ParameterSpecialization' The structure doesn't contain a 'dummy' property. Debug info i guess? |
May 19, 2013 Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | On Sun, 19 May 2013 12:43:37 +0200
"Gary Willoughby" <dev@kalekold.net> wrote:
> > Fixed.
> >
> > Removing the assert turned out to be the correct solution after
> > all.
> > The assert was based on a faulty assumption, and none of the
> > code
> > actually relied on the assertion passing (see the ticket above
> > for more
> > detailed info).
>
> Great, thanks Nick. I have however found a few other issues.
>
> Using this code:
>
> auto connection = new Connection(MySQLSocketType.phobos,
> "127.0.0.1", "root", "r00t", "Project");
> auto command = new Command(connection, "INSERT INTO
> tblUser (name, age) VALUES (?, ?)");
> command.prepare();
>
> ulong rowsAffected;
> string name;
>
> foreach (int age; 0..100000)
> {
> name = "Test User";
> command.bindParameter(name, 0);
> command.bindParameter(age, 1);
> command.execPrepared(rowsAffected);
> }
>
> Raises two simple to fix errors in the connection code.
>
> 1). mysql/connection.d(3845): Error: more initializers than fields (5) of ParameterSpecialization
>
> Basically the initialisation of the structure contains too many parameters.
>
> 2). mysql/connection.d(3858): Error: no property 'dummy' for type 'ParameterSpecialization'
>
> The structure doesn't contain a 'dummy' property. Debug info i guess?
Thanks, I'll look into these...
|
May 19, 2013 Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Sun, 19 May 2013 17:17:47 -0400 Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > > > > 1). mysql/connection.d(3845): Error: more initializers than fields (5) of ParameterSpecialization > > > > Basically the initialisation of the structure contains too many parameters. > > > > 2). mysql/connection.d(3858): Error: no property 'dummy' for type 'ParameterSpecialization' > > > > The structure doesn't contain a 'dummy' property. Debug info i guess? > > Thanks, I'll look into these... > That actually explains some changes I saw in one fork of mysqln that I was puzzled about. I have a feeling this "dummy" thing is a debugging-related relic from an earlier version that was removed incompletely. I'm going to see if I can find any history behind it in the earlier revisions. Likely I'll just end up removing the remaining traces of it: It doesn't appear to be serving any real purpose now, and it is the cause of both of those errors above. |
May 19, 2013 Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | On Sun, 19 May 2013 17:17:47 -0400 Nick Sabalausky <SeeWebsiteToContactMe@semitwist.com> wrote: > On Sun, 19 May 2013 12:43:37 +0200 > "Gary Willoughby" <dev@kalekold.net> wrote: > > > > 1). mysql/connection.d(3845): Error: more initializers than fields (5) of ParameterSpecialization > > > > Basically the initialisation of the structure contains too many parameters. > > > > 2). mysql/connection.d(3858): Error: no property 'dummy' for type 'ParameterSpecialization' > > > > The structure doesn't contain a 'dummy' property. Debug info i guess? > > Thanks, I'll look into these... > Should be fixed now. ATM, I don't have any code that's using the prepared statements feature, and I need to head out, so can you verify it? |
May 20, 2013 Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gary Willoughby | Am 18.05.2013 17:42, schrieb Gary Willoughby: > Hi, i've tried using this library for a simple query and i run > into an error. I wondered if this is a bug in the connection code. wouldn't it be a good idea to port the official mysql_client_test.c or parts of it into the unit test? its huge but seem to test every (corner) case around http://bazaar.launchpad.net/~mysql/mysql-server/5.7/view/head:/tests/mysql_client_test.c |
May 20, 2013 Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nick Sabalausky | > Should be fixed now. ATM, I don't have any code that's using the
> prepared statements feature, and I need to head out, so can you verify
> it?
Yes, with those changes everything I'm working with now works as expected.
|
May 20, 2013 Re: RFC: mysql-native - Supporting both Vibe.d and Phobos sockets | ||||
---|---|---|---|---|
| ||||
Posted in reply to dennis luehring | On Mon, 20 May 2013 07:28:29 +0200
dennis luehring <dl.soluz@gmx.net> wrote:
> Am 18.05.2013 17:42, schrieb Gary Willoughby:
> > Hi, i've tried using this library for a simple query and i run into an error. I wondered if this is a bug in the connection code.
>
> wouldn't it be a good idea to port the official mysql_client_test.c or parts of it into the unit test? its huge but seem to test every (corner) case around
>
> http://bazaar.launchpad.net/~mysql/mysql-server/5.7/view/head:/tests/mysql_client_test.c
I'm assuming that's [L]GPL, right? If so, then I don't think it could be used in whole, in part, or in any modified form, in mysql-native (Boost license). However, maybe it could safely be done as a separate "tester for mysql-native" project? (Of course, IANAL, so I don't know what the hell I'm talking about. YMMV. OMG WTF BBQ. Etc...)
|
Copyright © 1999-2021 by the D Language Foundation