Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should export ER_* error constants [rt.cpan.org #29691] #177

Open
mbeijen opened this issue Nov 14, 2017 · 0 comments
Open

Should export ER_* error constants [rt.cpan.org #29691] #177

mbeijen opened this issue Nov 14, 2017 · 0 comments

Comments

@mbeijen
Copy link
Contributor

mbeijen commented Nov 14, 2017

Migrated from rt.cpan.org#29691 (status was 'open')

Requestors:

From ilmari+cpan@ilmari.org on 2007-10-01 12:49:21:

Having access to the ER_* constants from mysqld_error.h would be useful
for comparing against $handle->err instead of having to use the numbers
directly or matching against $handle->errstr.

From capttofu@cpan.org on 2013-10-27 14:01:48:

On Mon Oct 01 08:49:21 2007, ilmari wrote:
> Having access to the ER_* constants from mysqld_error.h would be useful
> for comparing against $handle->err instead of having to use the numbers
> directly or matching against $handle->errstr.

The only issue with this is that one would have to have server headers in a perl client driver codebase and in many cases the driver is installed on a server with no server install

From ilmari@ilmari.org on 2013-10-27 14:55:09:

"Patrick Galbraith via RT" <bug-DBD-mysql@rt.cpan.org> writes:

> <URL: https://rt.cpan.org/Ticket/Display.html?id=29691 >
>
> On Mon Oct 01 08:49:21 2007, ilmari wrote:
>> Having access to the ER_* constants from mysqld_error.h would be useful
>> for comparing against $handle->err instead of having to use the numbers
>> directly or matching against $handle->errstr.
>
> The only issue with this is that one would have to have server headers
> in a perl client driver codebase and in many cases the driver is
> installed on a server with no server install

I dodn't know about other OSes, but on Debian/Ubuntu mysqld_error.h is
included in the libmysqlclient-dev package, which is needed to build
DBD::mysql anyway. It'd be simple to extract the constant names and
values at build time, so the header isn't required at runtime.

-- 
"I use RMS as a guide in the same way that a boat captain would use
 a lighthouse.  It's good to know where it is, but you generally
 don't want to find yourself in the same spot." - Tollef Fog Heen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants