duckdb 0.3.2-dev358.0 → 0.3.2-dev360.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/duckdb.cpp +7 -34
- package/src/duckdb.hpp +2 -2
package/package.json
CHANGED
package/src/duckdb.cpp
CHANGED
|
@@ -21591,7 +21591,7 @@ unique_ptr<FileHandle> LocalFileSystem::OpenFile(const string &path, uint8_t fla
|
|
|
21591
21591
|
DWORD desired_access;
|
|
21592
21592
|
DWORD share_mode;
|
|
21593
21593
|
DWORD creation_disposition = OPEN_EXISTING;
|
|
21594
|
-
DWORD flags_and_attributes = FILE_ATTRIBUTE_NORMAL
|
|
21594
|
+
DWORD flags_and_attributes = FILE_ATTRIBUTE_NORMAL;
|
|
21595
21595
|
bool open_read = flags & FileFlags::FILE_FLAGS_READ;
|
|
21596
21596
|
bool open_write = flags & FileFlags::FILE_FLAGS_WRITE;
|
|
21597
21597
|
if (open_read && open_write) {
|
|
@@ -21612,9 +21612,6 @@ unique_ptr<FileHandle> LocalFileSystem::OpenFile(const string &path, uint8_t fla
|
|
|
21612
21612
|
} else if (flags & FileFlags::FILE_FLAGS_FILE_CREATE_NEW) {
|
|
21613
21613
|
creation_disposition = CREATE_ALWAYS;
|
|
21614
21614
|
}
|
|
21615
|
-
if (flags & FileFlags::FILE_FLAGS_DIRECT_IO) {
|
|
21616
|
-
flags_and_attributes |= FILE_FLAG_WRITE_THROUGH;
|
|
21617
|
-
}
|
|
21618
21615
|
}
|
|
21619
21616
|
if (flags & FileFlags::FILE_FLAGS_DIRECT_IO) {
|
|
21620
21617
|
flags_and_attributes |= FILE_FLAG_NO_BUFFERING;
|
|
@@ -21644,7 +21641,6 @@ idx_t LocalFileSystem::GetFilePointer(FileHandle &handle) {
|
|
|
21644
21641
|
|
|
21645
21642
|
static DWORD FSInternalRead(FileHandle &handle, HANDLE hFile, void *buffer, int64_t nr_bytes, idx_t location) {
|
|
21646
21643
|
DWORD bytes_read = 0;
|
|
21647
|
-
bool overlapped_read = false;
|
|
21648
21644
|
OVERLAPPED ov = {};
|
|
21649
21645
|
ov.Internal = 0;
|
|
21650
21646
|
ov.InternalHigh = 0;
|
|
@@ -21652,20 +21648,9 @@ static DWORD FSInternalRead(FileHandle &handle, HANDLE hFile, void *buffer, int6
|
|
|
21652
21648
|
ov.OffsetHigh = location >> 32;
|
|
21653
21649
|
ov.hEvent = 0;
|
|
21654
21650
|
auto rc = ReadFile(hFile, buffer, (DWORD)nr_bytes, &bytes_read, &ov);
|
|
21655
|
-
if (rc
|
|
21656
|
-
|
|
21657
|
-
|
|
21658
|
-
throw IOException("Could not read file \"%s\" (error in ReadFile): %s", handle.path, error);
|
|
21659
|
-
} else {
|
|
21660
|
-
overlapped_read = true;
|
|
21661
|
-
}
|
|
21662
|
-
}
|
|
21663
|
-
if (overlapped_read) {
|
|
21664
|
-
rc = GetOverlappedResult(hFile, &ov, &bytes_read, true);
|
|
21665
|
-
if (rc == 0) {
|
|
21666
|
-
auto error = GetLastErrorAsString();
|
|
21667
|
-
throw IOException("Could not read file \"%s\" (error in GetOverlappedResult): %s", handle.path, error);
|
|
21668
|
-
}
|
|
21651
|
+
if (!rc) {
|
|
21652
|
+
auto error = GetLastErrorAsString();
|
|
21653
|
+
throw IOException("Could not read file \"%s\" (error in ReadFile): %s", handle.path, error);
|
|
21669
21654
|
}
|
|
21670
21655
|
return bytes_read;
|
|
21671
21656
|
}
|
|
@@ -21690,7 +21675,6 @@ int64_t LocalFileSystem::Read(FileHandle &handle, void *buffer, int64_t nr_bytes
|
|
|
21690
21675
|
|
|
21691
21676
|
static DWORD FSInternalWrite(FileHandle &handle, HANDLE hFile, void *buffer, int64_t nr_bytes, idx_t location) {
|
|
21692
21677
|
DWORD bytes_written = 0;
|
|
21693
|
-
bool overlapped_write = false;
|
|
21694
21678
|
OVERLAPPED ov = {};
|
|
21695
21679
|
ov.Internal = 0;
|
|
21696
21680
|
ov.InternalHigh = 0;
|
|
@@ -21698,20 +21682,9 @@ static DWORD FSInternalWrite(FileHandle &handle, HANDLE hFile, void *buffer, int
|
|
|
21698
21682
|
ov.OffsetHigh = location >> 32;
|
|
21699
21683
|
ov.hEvent = 0;
|
|
21700
21684
|
auto rc = WriteFile(hFile, buffer, (DWORD)nr_bytes, &bytes_written, &ov);
|
|
21701
|
-
if (rc
|
|
21702
|
-
|
|
21703
|
-
|
|
21704
|
-
throw IOException("Could not write file \"%s\" (error in WriteFile): %s", handle.path, error);
|
|
21705
|
-
} else {
|
|
21706
|
-
overlapped_write = true;
|
|
21707
|
-
}
|
|
21708
|
-
}
|
|
21709
|
-
if (overlapped_write) {
|
|
21710
|
-
rc = GetOverlappedResult(hFile, &ov, &bytes_written, true);
|
|
21711
|
-
if (rc == 0) {
|
|
21712
|
-
auto error = GetLastErrorAsString();
|
|
21713
|
-
throw IOException("Could not write file \"%s\" (error in GetOverlappedResult): %s", handle.path, error);
|
|
21714
|
-
}
|
|
21685
|
+
if (!rc) {
|
|
21686
|
+
auto error = GetLastErrorAsString();
|
|
21687
|
+
throw IOException("Could not write file \"%s\" (error in WriteFile): %s", handle.path, error);
|
|
21715
21688
|
}
|
|
21716
21689
|
return bytes_written;
|
|
21717
21690
|
}
|
package/src/duckdb.hpp
CHANGED
|
@@ -10,8 +10,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|
|
10
10
|
|
|
11
11
|
#pragma once
|
|
12
12
|
#define DUCKDB_AMALGAMATION 1
|
|
13
|
-
#define DUCKDB_SOURCE_ID "
|
|
14
|
-
#define DUCKDB_VERSION "0.3.2-
|
|
13
|
+
#define DUCKDB_SOURCE_ID "e6cd30e45"
|
|
14
|
+
#define DUCKDB_VERSION "0.3.2-dev360"
|
|
15
15
|
//===----------------------------------------------------------------------===//
|
|
16
16
|
// DuckDB
|
|
17
17
|
//
|