Re: バグ報告はこちらへ

このトピックの投稿一覧へ

なし Re: バグ報告はこちらへ

msg# 1.37
depth:
1
前の投稿 - 次の投稿 | 親投稿 - 子投稿なし | 投稿日時 2010/8/12 22:38
minom 
たびたび、失礼します。cli で実行してみたログです。

mysql> create table test.dd (
-> g smallint unsigned not null,
-> i smallint unsigned not null,
-> primary key(g, i)
-> );
Query OK, 0 rows affected (0.44 sec)mysql> create table test.ee (
-> g smallint unsigned not null,
-> i smallint unsigned not null auto_increment,
-> primary key(i, g)
-> );
Query OK, 0 rows affected (0.14 sec)
mysql> create table test.ff(
-> g smallint unsigned not null,
-> i smallint unsigned not null auto_increment,
-> primary key(g, i)
-> );
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

ご指摘の通り primary key を複数設定できるのは正しくて、
一つだけというのはワタシの勉強不足でした。

実行が失敗するのも事実とおもいます。
auto_increment を設定するとき、そのカラムを先に記述しないと
いけないように見えます。

裏付けるドキュメントは見つかりませんが・・・。

mysql のバージョンが原因でしょうか?
引き続き、調べてみます。
投票数:1 平均点:0.00

投稿ツリー

  条件検索へ