duckdb 0.8.1-dev26.0 → 0.8.1-dev31.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-dev26.0",
5
+ "version": "0.8.1-dev31.0",
6
6
  "description": "DuckDB node.js API",
7
7
  "gypfile": true,
8
8
  "dependencies": {
@@ -1,8 +1,8 @@
1
1
  #ifndef DUCKDB_VERSION
2
- #define DUCKDB_VERSION "0.8.1-dev26"
2
+ #define DUCKDB_VERSION "0.8.1-dev31"
3
3
  #endif
4
4
  #ifndef DUCKDB_SOURCE_ID
5
- #define DUCKDB_SOURCE_ID "7256503519"
5
+ #define DUCKDB_SOURCE_ID "8598919810"
6
6
  #endif
7
7
  #include "duckdb/function/table/system_functions.hpp"
8
8
  #include "duckdb/main/database.hpp"
@@ -78,6 +78,15 @@ bool Binder::BindTableFunctionParameters(TableFunctionCatalogEntry &table_functi
78
78
  }
79
79
  }
80
80
  if (child->type == ExpressionType::SUBQUERY) {
81
+ auto fun = table_function.functions.GetFunctionByOffset(0);
82
+ if (table_function.functions.Size() != 1 || fun.arguments.empty() ||
83
+ fun.arguments[0].id() != LogicalTypeId::TABLE) {
84
+ throw BinderException(
85
+ "Only table-in-out functions can have subquery parameters - %s only accepts constant parameters",
86
+ fun.name);
87
+ }
88
+ // this separate subquery binding path is only used by python_map
89
+ // FIXME: this should be unified with `BindTableInTableOutFunction` above
81
90
  if (seen_subquery) {
82
91
  error = "Table function can have at most one subquery parameter ";
83
92
  return false;
@@ -98,8 +107,8 @@ bool Binder::BindTableFunctionParameters(TableFunctionCatalogEntry &table_functi
98
107
  throw ParameterNotResolvedException();
99
108
  }
100
109
  if (!expr->IsScalar()) {
101
- error = "Table function requires a constant parameter";
102
- return false;
110
+ // should have been eliminated before
111
+ throw InternalException("Table function requires a constant parameter");
103
112
  }
104
113
  auto constant = ExpressionExecutor::EvaluateScalar(context, *expr, true);
105
114
  if (parameter_name.empty()) {
@@ -154,9 +163,7 @@ Binder::BindTableFunctionInternal(TableFunction &table_function, const string &f
154
163
  }
155
164
  }
156
165
  if (return_types.size() != return_names.size()) {
157
- throw InternalException(
158
- "Failed to bind \"%s\": Table function return_types and return_names must be of the same size",
159
- table_function.name);
166
+ throw InternalException("Failed to bind \"%s\": return_types/names must have same size", table_function.name);
160
167
  }
161
168
  if (return_types.empty()) {
162
169
  throw InternalException("Failed to bind \"%s\": Table function must return at least one column",