Skip to content

Commit

Permalink
chore: Update vendored sources to duckdb/duckdb@7c988cf (#359)
Browse files Browse the repository at this point in the history
Merge pull request duckdb/duckdb#13772 from pdet/cleaner_error_message
Merge pull request duckdb/duckdb#13771 from pdet/bump_sub
Merge pull request duckdb/duckdb#13773 from Tishj/pyfilesystem_assert_no_gil
Merge pull request duckdb/duckdb#13770 from lnkuiper/malloc_write_debug_only
Merge pull request duckdb/duckdb#13768 from Tishj/fsspec_gil_deadlock
Merge pull request duckdb/duckdb#13761 from lnkuiper/bugfixes

Co-authored-by: krlmlr <[email protected]>
  • Loading branch information
github-actions[bot] and krlmlr authored Sep 10, 2024
1 parent 35c626e commit 47b4f8d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
13 changes: 8 additions & 5 deletions src/duckdb/src/common/types/varint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool Varint::VarcharFormatting(const string_t &value, idx_t &start_pos, idx_t &e
is_zero = true;
return true;
}
// This is either a '+' or '-'. Hence invalid.
// This is either a '+' or '-'. Hence, invalid.
return false;
}
idx_t cur_pos = start_pos;
Expand Down Expand Up @@ -262,17 +262,16 @@ string Varint::VarcharToVarInt(const string_t &value) {
return result;
}

bool Varint::VarintToDouble(string_t &blob, double &result, bool &strict) {
bool Varint::VarintToDouble(const string_t &blob, double &result, bool &strict) {
result = 0;
bool is_negative;

if (blob.GetSize() < 4) {
throw InvalidInputException("Invalid blob size.");
}
auto blob_ptr = blob.GetData();

// Determine if the number is negative
is_negative = (blob_ptr[0] & 0x80) == 0;
bool is_negative = (blob_ptr[0] & 0x80) == 0;
idx_t byte_pos = 0;
for (idx_t i = blob.GetSize() - 1; i > 2; i--) {
if (is_negative) {
Expand All @@ -286,7 +285,11 @@ bool Varint::VarintToDouble(string_t &blob, double &result, bool &strict) {
if (is_negative) {
result *= -1;
}
return std::isfinite(result);
if (!std::isfinite(result)) {
// We throw an error
throw ConversionException("Could not convert varint '%s' to Double", VarIntToVarchar(blob));
}
return true;
}

} // namespace duckdb
6 changes: 3 additions & 3 deletions src/duckdb/src/function/table/version/pragma_version.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DUCKDB_PATCH_VERSION
#define DUCKDB_PATCH_VERSION "1-dev5229"
#define DUCKDB_PATCH_VERSION "1-dev5244"
#endif
#ifndef DUCKDB_MINOR_VERSION
#define DUCKDB_MINOR_VERSION 0
Expand All @@ -8,10 +8,10 @@
#define DUCKDB_MAJOR_VERSION 1
#endif
#ifndef DUCKDB_VERSION
#define DUCKDB_VERSION "v1.0.1-dev5229"
#define DUCKDB_VERSION "v1.0.1-dev5244"
#endif
#ifndef DUCKDB_SOURCE_ID
#define DUCKDB_SOURCE_ID "dd3cbcee00"
#define DUCKDB_SOURCE_ID "7c988cf7bf"
#endif
#include "duckdb/function/table/system_functions.hpp"
#include "duckdb/main/database.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/duckdb/src/include/duckdb/common/types/varint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Varint {
//! Function to convert Varchar to VARINT blob
DUCKDB_API static string VarcharToVarInt(const string_t &value);
//! ----------------------------------- Double Cast ----------------------------------- //
DUCKDB_API static bool VarintToDouble(string_t &blob, double &result, bool &strict);
DUCKDB_API static bool VarintToDouble(const string_t &blob, double &result, bool &strict);
};

//! ----------------------------------- (u)Integral Cast ----------------------------------- //
Expand Down

0 comments on commit 47b4f8d

Please sign in to comment.