You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2022/04/12 15:51:20 UTC

[Bug 66010] New: mod_authz_dbd doc select-groups example fails on reserved word group in Mysql

https://bz.apache.org/bugzilla/show_bug.cgi?id=66010

            Bug ID: 66010
           Summary: mod_authz_dbd doc select-groups example fails on
                    reserved word group in Mysql
           Product: Apache httpd-2
           Version: 2.5-HEAD
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: mod_authz_dbd
          Assignee: bugs@httpd.apache.org
          Reporter: christopher.lott@icloud.com
  Target Milestone: ---

Please consider this report of a minor documentation bug. The documentation for
Apache module mod_authz_dbd at
https://httpd.apache.org/docs/2.4/mod/mod_authz_dbd.html suggests using this
SQL select statement to query a database for a user's group memberships:

    AuthzDBDQuery "SELECT group FROM authz WHERE user = %s"

I'm using Mysql via the APR mysql library.  The Mysql server seems to treat
'group' as a reserved word. On apache HTTPD server startup this error appears:

[Tue Apr 12 15:39:06.673658 2022] [dbd:error] [pid 9:tid 140197568732480]
(20014)Internal error (specific information not available): AH00632: failed to
prepare SQL statements: You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use near
'group FROM authz WHERE user = ?' at line 1

I suggest changing this doc example to use back-ticks, altho that might be
hopelessly specific to Mysql:

    AuthzDBDQuery "SELECT `group` FROM authz WHERE user = %s"

Alternately you might avoid the reserved word entirely and use something like
this:

    AuthzDBDQuery "SELECT user_group FROM authz WHERE user = %s"

It might also help if you add a note about the reserved word 'group'.

Thanks for listening!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66010] mod_authz_dbd doc select-groups example fails on reserved word group in Mysql

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66010

Giovanni Bechis <gi...@paclan.it> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Giovanni Bechis <gi...@paclan.it> ---
Fixed in r1900077.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66010] mod_authz_dbd doc select-groups example fails on reserved word group in Mysql

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66010

--- Comment #1 from Giovanni Bechis <gi...@paclan.it> ---
Created attachment 38246
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=38246&action=edit
Documentation fix

Documentation fix that should be enough to address the issue.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 66010] mod_authz_dbd doc select-groups example fails on reserved word group in Mysql

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=66010

--- Comment #2 from Chris Lott <ch...@icloud.com> ---
Thanks for the quick reply, the patch looks great!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org