MySQL Forums
Forum List  »  Italian

Check in Create table
Posted by: Davide Dal Frà
Date: February 18, 2011 05:04AM

Sto provando da alcuni giorni a creare tabelle (sia MyIsam che InnoDB) con l'opzione check nella create table:


CREATE TABLE test ( campo varchar ( 1 ), check (campo='R' or campo='T') );

Poi provo a fare una insert:

insert into test values ('A');
Query OK, 1 row affected (0.00 sec)
mysql> show warnings;
Empty set (0.00 sec)

mysql> show errors;
Empty set (0.00 sec)

mysql> select * from test;
| campo |
| A |

Avendo impostato il CHECK sul field 'campo' come mai la insert avviene in modo corretto?


Davide Dal Frà

Options: ReplyQuote

Written By
Check in Create table
February 18, 2011 05:04AM
March 09, 2011 07:08PM
April 05, 2011 03:39AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.