You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Bojan Smojver <bo...@rexursive.com> on 2006/09/25 01:31:35 UTC

[PATCH]: DBD prepared statement arguments rework for 1.2.x

Here is a "backport" of the _prepare() unified parsing support to  
1.2.x and with it a more explicit support for SQL types when using  
_p[v]select/query.

Please review, test, flame etc.

-- 
Bojan

Re: [PATCH]: DBD prepared statement arguments rework for 1.2.x

Posted by Bojan Smojver <bo...@rexursive.com>.
On Mon, 2006-09-25 at 09:27 +0100, Joe Orton wrote:

> That still has to wait for a minor version bump; the versioning rules 
> don't permit API extensions in patch releases:
> 
> "Changes to the API, to the signatures of public functions, or to the 
> interpretation of function parameters is not allowed."
> 
> http://apr.apache.org/versioning.html

Bummer! Ah well, we'll wait until 1.3.x gets out the door.

-- 
Bojan


Re: [PATCH]: DBD prepared statement arguments rework for 1.2.x

Posted by Joe Orton <jo...@redhat.com>.
On Mon, Sep 25, 2006 at 11:09:12AM +1000, Bojan Smojver wrote:
> Quoting Garrett Rooney <ro...@electricjellyfish.net>:
> 
> >I guess I'm not seeing how adding a bunch of new format strings isn't
> >changing anything...  Am I just misunderstanding how the patch works?
> >It looks like it replaces the existing format string parsing with all
> >new parsing.  Is it just that the new parsing is a superset of the
> >existing stuff?
> 
> Yes, that's how it should work - as a superset. There are new format  
> strings that we would support, apart from already supported ones,  

That still has to wait for a minor version bump; the versioning rules 
don't permit API extensions in patch releases:

"Changes to the API, to the signatures of public functions, or to the 
interpretation of function parameters is not allowed."

http://apr.apache.org/versioning.html

joe

Re: [PATCH]: DBD prepared statement arguments rework for 1.2.x

Posted by Bojan Smojver <bo...@rexursive.com>.
Quoting Garrett Rooney <ro...@electricjellyfish.net>:

> Ok, in that case it sounds good to me.

Cool. Thanks for your input.

Given that there has been some talk on the list of the 1.2.8 release  
recently, I will wait until other people say something about this  
before any changes are made to the repository.

-- 
Bojan

Re: [PATCH]: DBD prepared statement arguments rework for 1.2.x

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/24/06, Bojan Smojver <bo...@rexursive.com> wrote:
> Quoting Garrett Rooney <ro...@electricjellyfish.net>:
>
> > I guess I'm not seeing how adding a bunch of new format strings isn't
> > changing anything...  Am I just misunderstanding how the patch works?
> > It looks like it replaces the existing format string parsing with all
> > new parsing.  Is it just that the new parsing is a superset of the
> > existing stuff?
>
> Yes, that's how it should work - as a superset. There are new format
> strings that we would support, apart from already supported ones,
> which were %s and %d (only in PostgreSQL ATM). The %s and %d would
> remain with the same meaning and anything that isn't specifically
> defined would still be interpreted as %s (i.e. VARCHAR), just like it
> is now (although, I find that to be a bad idea - we should stick to
> explicit meanings).
>
> The parsing would get moved out of the drivers, so that we can rely on
> it being identical for all drivers. Which would make things a bit more
> consistent.

Ok, in that case it sounds good to me.

-garrett

Re: [PATCH]: DBD prepared statement arguments rework for 1.2.x

Posted by Bojan Smojver <bo...@rexursive.com>.
Quoting Garrett Rooney <ro...@electricjellyfish.net>:

> I guess I'm not seeing how adding a bunch of new format strings isn't
> changing anything...  Am I just misunderstanding how the patch works?
> It looks like it replaces the existing format string parsing with all
> new parsing.  Is it just that the new parsing is a superset of the
> existing stuff?

Yes, that's how it should work - as a superset. There are new format  
strings that we would support, apart from already supported ones,  
which were %s and %d (only in PostgreSQL ATM). The %s and %d would  
remain with the same meaning and anything that isn't specifically  
defined would still be interpreted as %s (i.e. VARCHAR), just like it  
is now (although, I find that to be a bad idea - we should stick to  
explicit meanings).

The parsing would get moved out of the drivers, so that we can rely on  
it being identical for all drivers. Which would make things a bit more  
consistent.

-- 
Bojan

Re: [PATCH]: DBD prepared statement arguments rework for 1.2.x

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/24/06, Bojan Smojver <bo...@rexursive.com> wrote:
> Quoting Garrett Rooney <ro...@electricjellyfish.net>:
>
> > Sure, it's not
> > adding any new functions or anything, but it's changing the semantics
> > of the function parameters in a non-compatible way.
>
> I tried no to do this, actually. The idea was that everything that
> works in 1.2.x before this patch should work the same with the patch.
> So, any change of semantics was completely unintentional and is a bug.
>
> Could you point out the details so that I can have a better
> understanding as to what's broken?

I guess I'm not seeing how adding a bunch of new format strings isn't
changing anything...  Am I just misunderstanding how the patch works?
It looks like it replaces the existing format string parsing with all
new parsing.  Is it just that the new parsing is a superset of the
existing stuff?

-garrett

Re: [PATCH]: DBD prepared statement arguments rework for 1.2.x

Posted by Bojan Smojver <bo...@rexursive.com>.
Quoting Garrett Rooney <ro...@electricjellyfish.net>:

> Sure, it's not
> adding any new functions or anything, but it's changing the semantics
> of the function parameters in a non-compatible way.

I tried no to do this, actually. The idea was that everything that  
works in 1.2.x before this patch should work the same with the patch.  
So, any change of semantics was completely unintentional and is a bug.

Could you point out the details so that I can have a better  
understanding as to what's broken?

-- 
Bojan

Re: [PATCH]: DBD prepared statement arguments rework for 1.2.x

Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 9/24/06, Bojan Smojver <bo...@rexursive.com> wrote:
> Here is a "backport" of the _prepare() unified parsing support to
> 1.2.x and with it a more explicit support for SQL types when using
> _p[v]select/query.
>
> Please review, test, flame etc.

The patch seems reasonable enough, but I'm not sure if we can backport
it and still follow our compatibility guidelines.  Sure, it's not
adding any new functions or anything, but it's changing the semantics
of the function parameters in a non-compatible way.  Honestly, I'm not
sure that's even allowed for the 1.3.x line (i.e. trunk), we might be
stuck calling the new functionality apr_dbd_prepare2 (or some other
name), and maintaining apr_dbd_prepare with the db specific syntax...

-garrett