Skip to content

Commit

Permalink
windows: fix a bug that over 128MB column value can't be read
Browse files Browse the repository at this point in the history
[groonga-dev,01088]

Reported by ongaeshi. Thanks!!!
  • Loading branch information
kou committed Nov 5, 2012
1 parent 5d46a5f commit 96ab5e1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions lib/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1526,9 +1526,15 @@ inline static grn_rc
grn_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags, size_t maxsize)
{
if ((flags & O_CREAT)) {
DWORD dwCreationDisposition;
if (flags & O_EXCL) {
dwCreationDisposition = CREATE_NEW;
} else {
dwCreationDisposition = OPEN_ALWAYS;
}
fi->fh = CreateFile(path, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);
dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, 0);
if (fi->fh == INVALID_HANDLE_VALUE) {
SERR("CreateFile");
return ctx->rc;
Expand Down Expand Up @@ -1629,9 +1635,15 @@ grn_open(grn_ctx *ctx, fileinfo *fi, const char *path, int flags, size_t maxsize
{
/* may be wrong if flags is just only O_RDWR */
if ((flags & O_CREAT)) {
DWORD dwCreationDisposition;
if (flags & O_EXCL) {
dwCreationDisposition = CREATE_NEW;
} else {
dwCreationDisposition = OPEN_ALWAYS;
}
fi->fh = CreateFile(path, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE, NULL,
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);
dwCreationDisposition, FILE_ATTRIBUTE_NORMAL, 0);
if (fi->fh == INVALID_HANDLE_VALUE) {
SERR("CreateFile");
return ctx->rc;
Expand Down

0 comments on commit 96ab5e1

Please sign in to comment.