duckdb 0.8.1-dev51.0 → 0.8.1-dev65.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 CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "duckdb",
3
3
  "main": "./lib/duckdb.js",
4
4
  "types": "./lib/duckdb.d.ts",
5
- "version": "0.8.1-dev51.0",
5
+ "version": "0.8.1-dev65.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -114,9 +114,22 @@ string FileSystem::GetEnvVariable(const string &env) {
114
114
  return WindowsUtil::UnicodeToUTF8(res_w);
115
115
  }
116
116
 
117
+ static bool StartsWithSingleBackslash(const string &path) {
118
+ if (path.size() < 2) {
119
+ return false;
120
+ }
121
+ if (path[0] != '/' && path[0] != '\\') {
122
+ return false;
123
+ }
124
+ if (path[1] == '/' || path[1] == '\\') {
125
+ return false;
126
+ }
127
+ return true;
128
+ }
129
+
117
130
  bool FileSystem::IsPathAbsolute(const string &path) {
118
131
  // 1) A single backslash or forward-slash
119
- if (PathMatched(path, "\\") || PathMatched(path, "/")) {
132
+ if (StartsWithSingleBackslash(path)) {
120
133
  return true;
121
134
  }
122
135
  // 2) A disk designator with a backslash (e.g., C:\ or C:/)
@@ -131,7 +144,7 @@ bool FileSystem::IsPathAbsolute(const string &path) {
131
144
  string FileSystem::NormalizeAbsolutePath(const string &path) {
132
145
  D_ASSERT(IsPathAbsolute(path));
133
146
  auto result = StringUtil::Lower(FileSystem::ConvertSeparators(path));
134
- if (PathMatched(result, "\\")) {
147
+ if (StartsWithSingleBackslash(result)) {
135
148
  // Path starts with a single backslash or forward slash
136
149
  // prepend drive letter
137
150
  return GetWorkingDirectory().substr(0, 2) + result;
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.8.1-dev51"
2
+ #define DUCKDB_VERSION "0.8.1-dev65"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "e84cc1acb8"
5
+ #define DUCKDB_SOURCE_ID "a81a31a0af"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -29,6 +29,7 @@ LocalTableStorage::LocalTableStorage(DataTable &table)
29
29
  if (art.constraint_type != IndexConstraintType::NONE) {
30
30
  // unique index: create a local ART index that maintains the same unique constraint
31
31
  vector<unique_ptr<Expression>> unbound_expressions;
32
+ unbound_expressions.reserve(art.unbound_expressions.size());
32
33
  for (auto &expr : art.unbound_expressions) {
33
34
  unbound_expressions.push_back(expr->Copy());
34
35
  }
@@ -252,7 +253,7 @@ shared_ptr<LocalTableStorage> LocalTableManager::MoveEntry(DataTable &table) {
252
253
  return nullptr;
253
254
  }
254
255
  auto storage_entry = std::move(entry->second);
255
- table_storage.erase(table);
256
+ table_storage.erase(entry);
256
257
  return storage_entry;
257
258
  }
258
259
 
@@ -16,7 +16,7 @@ DataFileType MagicBytes::CheckMagicBytes(FileSystem *fs_p, const string &path) {
16
16
  char buffer[MAGIC_BYTES_READ_SIZE];
17
17
 
18
18
  handle->Read(buffer, MAGIC_BYTES_READ_SIZE);
19
- if (memcmp(buffer, "SQLite format 3\0\0\0", 16) == 0) {
19
+ if (memcmp(buffer, "SQLite format 3\0", 16) == 0) {
20
20
  return DataFileType::SQLITE_FILE;
21
21
  }
22
22
  if (memcmp(buffer, "PAR1", 4) == 0) {