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: [email protected]
          Reporter: [email protected]
  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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to