<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Hexe19 &#187; Database</title>
	<atom:link href="http://hexe19.net/category/database/feed/" rel="self" type="application/rss+xml" />
	<link>http://hexe19.net</link>
	<description>*scratch*</description>
	<lastBuildDate>Sat, 16 May 2009 03:54:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SQLite : disk I/O error(10) at dbdimp.c line 403</title>
		<link>http://hexe19.net/2008/04/21/42/sqlite-disk-io-error10-at-dbdimpc-line-403/</link>
		<comments>http://hexe19.net/2008/04/21/42/sqlite-disk-io-error10-at-dbdimpc-line-403/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 11:43:48 +0000</pubDate>
		<dc:creator>you</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[Perl Database]]></category>

		<guid isPermaLink="false">http://hexe19.net/?p=42</guid>
		<description><![CDATA[ひさしぶりに、 SQLite を触ってみたら変なエラーが出たのでメモ。
環境
Windows XP SP2
FedoraCore7 on coLinux
SQLite 3.4.2

perl から sqlite を操作しても、 sqlite3 のコンソールから直接操作しても、cofs 上の database ファイルは扱えなかった。
※ファイルの作成はできるけど、 CREATE DATABASE とかの操作をすると
disk I/O error(10) at dbdimp.c line 403
解決策は、データベースを保存する場所を、cofs じゃない場所にしただけ。
tmpfs 上、ext3 上にデータベースを作成した場合はＯＫだった。
#!/bin/perl

use strict;
use warnings;
use DBI;

my $dbname;

$dbname = 'test.db'; # OK:ext*,tmpfs NG:cofs
unlink($dbname) if (-e $dbname); # テストだから毎回新規作成したい

unless (-e $dbname) {
    my ($dbh, $sql, $rc);

    [...]]]></description>
			<content:encoded><![CDATA[<p>ひさしぶりに、 SQLite を触ってみたら変なエラーが出たのでメモ。</p>
<ul>環境</p>
<li>Windows XP SP2</li>
<li>FedoraCore7 on coLinux</li>
<li>SQLite 3.4.2</li>
</ul>
<p>perl から sqlite を操作しても、 sqlite3 のコンソールから直接操作しても、cofs 上の database ファイルは扱えなかった。<br />
※ファイルの作成はできるけど、 CREATE DATABASE とかの操作をすると<br />
<code>disk I/O error(10) at dbdimp.c line 403</code></p>
<p>解決策は、データベースを保存する場所を、cofs じゃない場所にしただけ。<br />
tmpfs 上、ext3 上にデータベースを作成した場合はＯＫだった。</p>
<pre class="code">#!/bin/perl

use strict;
use warnings;
use DBI;

my $dbname;

$dbname = 'test.db'; # OK:ext*,tmpfs NG:cofs
unlink($dbname) if (-e $dbname); # テストだから毎回新規作成したい

unless (-e $dbname) {
    my ($dbh, $sql, $rc);

    $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {PrintError=>0});
    die "Error: $DBI::errstr\n" unless ($dbh);

    # cofs の時は CREATE のタイミングで↓のエラーが発生する
    # disk I/O error(10) at dbdimp.c line 403
    $sql = "CREATE TABLE users (id integer primary key, name varchar(32), age integer)";
    $rc = $dbh->do($sql);
    print "$DBI::errstr\n" unless ($rc);
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://hexe19.net/2008/04/21/42/sqlite-disk-io-error10-at-dbdimpc-line-403/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
