Home > Archives > February 2008 Archive
February 2008 Archive
SQL_MODE=NO_ENGINE_SUBSTITUTIONを設定していると、create functionでエラー発生
- February 27, 2008 5:32 PM
5.1.23(Windows ZIP/Setup.EXE (x86))で、SQL_MODE=NO_ENGINE_SUBSTITUTIONを設定していると、create functionでエラー発生
バグらしい。
MySQL Bugs: #32633: Can not create any routine if SQL_MODE=no_engine_substitution
5.1.22では作成されるのだけど、NO_ENGINE_SUBSTITUTIONはstoreされない。
そもそも、これもバグらしいので、バグを修正しようとして、5.1.23で更に悪化した?
- Comments (Close): 0
- TrackBack (Close): 0
VARCHARの最大長
- February 26, 2008 1:53 PM
CHAR(M)
ストレージ消費:M文字
最大:255文字
VARCHAR
ストレージ消費:M文字+1または2バイト
最大:65535バイト
実際のVARCHARの最大は、65532バイト。
[test]> create table inno(a varchar(21845)) default character set utf8 engine=innodb;ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
[test]> create table inno(a varchar(21844)) default character set utf8 engine=innodb;
Query OK, 0 rows affected (0.02 sec)
21844 * 3 = 65532
[test]> create table inno2(a varchar(65533)) default character set latin1 engine=innodb;ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
[test]> create table inno2(a varchar(65532)) default character set latin1 engine=innodb;
Query OK, 0 rows affected (0.07 sec)
65532+2=65534
残り1バイトは?
ちなみに行の最大は65535バイトという制限がある。
[test]> create table maxrow(a int, b varchar(65529)) default character set latin1 engine=innodb;ERROR 1118 (42000): Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. You have to change some columns to TEXT or BLOBs
[test]> create table maxrow(a int, b varchar(65528)) default character set latin1 engine=innodb;
Query OK, 0 rows affected (0.03 sec)
4+65528=65532
- Comments (Close): 0
- TrackBack (Close): 0
バイナリ型とutf8_binaryの違い
- February 26, 2008 1:06 PM
バイナリ型と、utf8_binaryの違い
[test]> create table t10(a int, b char binary, c char character set binary); Query OK, 0 rows affected (0.14 sec)[test]> show create table t10;
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| t10 | CREATE TABLE `t10` (
`a` int(11) DEFAULT NULL,
`b` char(1) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`c` binary(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 |
+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
バイナリ型は、そのまま格納するので、たとえばUTF-8 4バイト文字がそのまま入る。
COLLATIONだけバイナリにした場合は、たとえばUTF-8 4バイト文字などは、エラーで弾かれる。(ストリクトモード時)
- Comments (Close): 0
- TrackBack (Close): 0
スレーブを再起動時に、勝手にレプリケーションを再開してほしくないときは
- February 13, 2008 4:44 PM
1.--init-fileでstop slave;と書いたファイルを指定する
2.--skip-slave-startオプションで起動
- Comments (Close): 0
- TrackBack (Close): 0
VMWare Toolsのインストール
- February 5, 2008 11:44 AM
/usr/bin/vmware-config-tools.pl
で解像度などを設定。自動で/usr/bin/vmware-toolboxを起動するために、
個人設定
他の個人設定
セッション
自動起動するプログラム
追加
でvmware-toolbox --iconifyを入力
- Comments (Close): 0
- TrackBack (Close): 0