Reading sql.conf says (summarized) "use any query/tables you want" and that item 0 should be "Row ID (currently unused)". Great. I want to ignore that id column and create a new primary key. Is there any reason that I can't create a primary key on (UserName, Attribute) as a compound index? It was thus be saying that for each user an attribute can once and only once. Is that a safe assumption? I ask because I like the functionality of "replace into..." of MySQL, but it only works with the primary key in a table.
So, it'll look like this. But, will it work properly?
mysql> desc radcheck;
+-----------+--------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+--------------+------+-----+---------+-------+
| UserName | varchar(64) | | PRI | | |
| Attribute | varchar(32) | | PRI | | |
| Value | varchar(253) | | | | |
| op | char(2) | YES | | NULL | |
+-----------+--------------+------+-----+---------+-------+
4 rows in set (0.00 sec)
mysql> show index from radcheck;
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Comment |
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+---------+
| radcheck | 0 | PRIMARY | 1 | UserName | A | NULL | NULL | NULL | |
| radcheck | 0 | PRIMARY | 2 | Attribute | A | 2 | NULL | NULL | |
+----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+---------+
2 rows in set (0.00 sec)
:: sql.conf ::
authorize_check_query = "SELECT 1,UserName,Attribute,Value,op FROM ${authcheck_table} WHERE UserName = '%{SQL-User-Name}'"
authorize_reply_query = "SELECT 1,UserName,Attribute,Value,op FROM ${authreply_table} WHERE UserName = '%{SQL-User-Name}'"
Christopher S. Cosby
SciCare Software Services
- - - - - - - Appended by Scientific-Atlanta, Inc. - - - - - - -
This e-mail and any attachments may contain information which is confidential, proprietary, privileged or otherwise protected by law. The information is solely intended for the named addressee (or a person responsible for delivering it to the addressee). If you are not the intended recipient of this message, you are not authorized to read, print, retain, copy or disseminate this message or any part of it. If you have received this e-mail in error, please notify the sender immediately by return e-mail and delete it from your computer.
