> On Friday 08 November 2002 16:56, Chris Parker wrote:
  > > I just committed updates for mysql,postgre,db2,oracle that change the
  > > order ( so op is "between" Attribute and Value ) and make it NOT NULL.
  > >
  > > I did not set a default.  I think having the server reject invalid
  > > entries upon an insert is the best way to handle this problem.
  > >
  > > -Chris
  > 
  > Here's the output when I use the new changes.  Just moving the type of error 
  > from a NULL op to an empty op.
  > 
  > Kevin
  > 
  > mysql> CREATE TABLE radcheck (
  >     ->   id int(11) unsigned NOT NULL auto_increment,
  >     ->   UserName varchar(64) NOT NULL default '',
  >     ->   Attribute varchar(32)  NOT NULL default '',
  >     ->   op char(2) NOT NULL,
  >     ->   Value varchar(253) NOT NULL default '',
  >     ->   PRIMARY KEY  (id),
  >     ->   KEY UserName (UserName(32))
  >     -> ) ;
  > Query OK, 0 rows affected (1.46 sec)
  > mysql> insert into radcheck (username, attribute, value) values ('test', 
  > 'passwd', 'blah');
  > Query OK, 1 row affected (0.00 sec)
  > mysql> select * from radcheck;
  > +----+----------+-----------+----+-------+
  > | id | UserName | Attribute | op | Value |
  > +----+----------+-----------+----+-------+
  > |  1 | test     | passwd    |    | blah  |
  > +----+----------+-----------+----+-------+
  > 1 row in set (0.00 sec)
  > mysql> 
  > 

I was amazed so I had to see it for myself.  This seems to be a
major bug in mysql.  I've grown used to oracle where the behaviour
is correct and doesn't allow the insertion to take place.

I guess a *bad* value as a default would be better than an
empty string.

Brian


- 
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to