ronantakizawa/codereview-bench huggingface dataset:
Repository: duckdb/duckdb
File: src/include/duckdb/storage/compression/roaring/roaring.hpp (C++)

Code before:
				statistics->UpdateNumericStats<bool>(src_bit);
			}
			byte |= src_bit << bit_pos;
			bit_pos++;

			// flush
			if (bit_pos == 8) {
				*dst++ = byte;
				byte = 0;
				bit_pos = 0;
			}
		}
	} else {
		bool last_bit_value = false;
		for (idx_t i = 0; i < count; i++) {
			const uint8_t valid = validity_mask->RowIsValid(i);
			src_bit = valid ? src[i] : src_bit;
			const uint8_t bit = (src_bit & valid) | (last_bit_value & ~valid);

			byte |= bit << bit_pos;
			bit_pos++;

			last_bit_value = src_bit;

			if (UPDATE_STATS) {
				statistics->UpdateNumericStats<bool>(src_bit);
				if (valid) {
					statistics->SetHasNoNullFast();
				} else {
					statistics->SetHasNullFast();
				}
			}

			// flush
			if (bit_pos == 8) {
				*dst++ = byte;
				byte = 0;
				bit_pos = 0;
			}
		}
	}
	// flush last partial byte
	if (bit_pos != 0) {
		*dst = byte;
	}
}
} // namespace roaring

} // namespace duckdb


Review comment (bug):
This is also wrong btw, we shouldn't be updating the stats for null values
We could have the scenario where we have NULL followed by only `true`, for this one NULL value we are now writing `false`, removing the possibility to skip this segment in a filter that says `!= false`

Code after:
				statistics->UpdateNumericStats<bool>(src_bit);
			}
			byte |= src_bit << bit_pos;
			bit_pos++;

			// flush
			if (bit_pos == 8) {
				*dst++ = byte;
				byte = 0;
				bit_pos = 0;
			}
		}
	} else {
		bool last_bit_value = false;
		for (idx_t i = 0; i < count; i++) {
			const uint8_t valid = validity_mask->RowIsValid(i);
			src_bit = valid ? src[i] : src_bit;
			const uint8_t bit = (src_bit & valid) | (last_bit_value & ~valid);

			byte |= bit << bit_pos;
			bit_pos++;

			last_bit_value = src_bit;

			if (UPDATE_STATS) {
				if (valid) {
					statistics->UpdateNumericStats<bool>(src_bit);
					statistics->SetHasNoNullFast();
				} else {
					statistics->SetHasNullFast();
				}
			}

			// flush
			if (bit_pos == 8) {
				*dst++ = byte;
				byte = 0;
				bit_pos = 0;
			}
		}
	}
	// flush last partial byte
	if (bit_pos != 0) {
		*dst = byte;
	}
}
} // namespace roaring

} // namespace duckdb
Repository: duckdb/duckdb
File: src/include/duckdb/execution/operator/projection/physical_tableinout_function.hpp (C++)

Code before:

public:
	unique_ptr<OperatorState> GetOperatorState(ExecutionContext &context) const override;
	unique_ptr<GlobalOperatorState> GetGlobalOperatorState(ClientContext &context) const override;
	static void SetOrdinality(DataChunk &chunk, const optional_idx &ordinality_column_idx, const idx_t &ordinality_idx,
	                          const idx_t &ordinality);
	OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
	                           GlobalOperatorState &gstate, OperatorState &state) const override;
	OperatorFinalizeResultType FinalExecute(ExecutionContext &context, DataChunk &chunk, GlobalOperatorState &gstate,
	                                        OperatorState &state) const override;

	bool ParallelOperator() const override {
		return true;
	}

	bool RequiresFinalExecute() const override {
		return function.in_out_function_final;
	}

	InsertionOrderPreservingMap<string> ParamsToString() const override;

	//! Information for WITH ORDINALITY
	optional_idx ordinality_idx;

	bool SinkOrderDependent() const override {
		return function.in_out_function_order_dependent;
	}

private:
	//! The table function
	TableFunction function;
	//! Bind data of the function
	unique_ptr<FunctionData> bind_data;
	//! The set of column ids to fetch
	vector<ColumnIndex> column_ids;
	//! The set of input columns to project out
	vector<column_t> projected_input;
};

} // namespace duckdb


Review comment (suggestion):
`PhysicalTableInOutFunction` is not a sink but an operator - so this will not have any effect. You want `OperatorOrder()`

Code after:

public:
	unique_ptr<OperatorState> GetOperatorState(ExecutionContext &context) const override;
	unique_ptr<GlobalOperatorState> GetGlobalOperatorState(ClientContext &context) const override;
	static void SetOrdinality(DataChunk &chunk, const optional_idx &ordinality_column_idx, const idx_t &ordinality_idx,
	                          const idx_t &ordinality);
	OperatorResultType Execute(ExecutionContext &context, DataChunk &input, DataChunk &chunk,
	                           GlobalOperatorState &gstate, OperatorState &state) const override;
	OperatorFinalizeResultType FinalExecute(ExecutionContext &context, DataChunk &chunk, GlobalOperatorState &gstate,
	                                        OperatorState &state) const override;

	bool ParallelOperator() const override {
		return true;
	}

	bool RequiresFinalExecute() const override {
		return function.in_out_function_final;
	}

	InsertionOrderPreservingMap<string> ParamsToString() const override;

	//! Information for WITH ORDINALITY
	optional_idx ordinality_idx;

	OrderPreservationType OperatorOrder() const override {
		return function.order_preservation_type;
	}

private:
	//! The table function
	TableFunction function;
	//! Bind data of the function
	unique_ptr<FunctionData> bind_data;
	//! The set of column ids to fetch
	vector<ColumnIndex> column_ids;
	//! The set of input columns to project out
	vector<column_t> projected_input;
};

} // namespace duckdb
Repository: duckdb/duckdb
File: src/planner/expression_binder/column_alias_binder.cpp (C++)

Code before:
		return false;
	}

	// We try to find the alias in the alias_map and return false, if no alias exists.
	auto alias_entry = bind_state.alias_map.find(expr.column_names.back());
	if (alias_entry == bind_state.alias_map.end()) {
		return false;
	}

	if (visited_select_indexes.find(alias_entry->second) != visited_select_indexes.end()) {
		// self-referential alias cannot be resolved
		return false;
	}

	// We found an alias, so we copy the alias expression into this expression.
	auto original_expr = bind_state.BindAlias(alias_entry->second);
	expr_ptr = std::move(original_expr);
	visited_select_indexes.insert(alias_entry->second);

	result = enclosing_binder.BindExpression(expr_ptr, depth, root_expression);
	visited_select_indexes.erase(alias_entry->second);
	return true;
}

bool ColumnAliasBinder::DoesColumnAliasExist(const ColumnRefExpression &colref) {
	if (!colref.IsQualified()) {
		return bind_state.alias_map.find(colref.column_names[0]) != bind_state.alias_map.end();
	}
	return false;
	// return bind_state.alias_map.find(colref.column_names.back()) != bind_state.alias_map.end();
}

} // namespace duckdb


Review comment (suggestion):
We now support `alias.[alias_name]` so this is not correct. This should be `IsPotentialAlias(colref)` and stay as `colref.column_names.back()` - we could add this as an early out and keep the earlier code:

```
if (!IsPotentialAlias(colref)) {
    return false;
}
return ...
```

Code after:
		return false;
	}

	// We try to find the alias in the alias_map and return false, if no alias exists.
	auto alias_entry = bind_state.alias_map.find(expr.column_names.back());
	if (alias_entry == bind_state.alias_map.end()) {
		return false;
	}

	if (visited_select_indexes.find(alias_entry->second) != visited_select_indexes.end()) {
		// self-referential alias cannot be resolved
		return false;
	}

	// We found an alias, so we copy the alias expression into this expression.
	auto original_expr = bind_state.BindAlias(alias_entry->second);
	expr_ptr = std::move(original_expr);
	visited_select_indexes.insert(alias_entry->second);

	result = enclosing_binder.BindExpression(expr_ptr, depth, root_expression);
	visited_select_indexes.erase(alias_entry->second);
	return true;
}

bool ColumnAliasBinder::DoesColumnAliasExist(const ColumnRefExpression &colref) {
	if (!ExpressionBinder::IsPotentialAlias(colref)) {
		return false;
	}
	return bind_state.alias_map.find(colref.column_names[0]) != bind_state.alias_map.end();
}

} // namespace duckdb
Repository: duckdb/duckdb
File: extension/core_functions/scalar/struct/struct_values.cpp (C++)

Code before:
			}
		}
	}
}

// Ensure input is a STRUCT, set return type to an unnamed STRUCT with same child types
static unique_ptr<FunctionData> StructValuesBind(ClientContext &context, ScalarFunction &bound_function,
                                                 vector<unique_ptr<Expression>> &arguments) {
	if (arguments[0]->return_type.id() != LogicalTypeId::STRUCT) {
		throw InvalidInputException("struct_values() expects a STRUCT argument");
	}

	// Build unnamed children list using only types, with empty names
	child_list_t<LogicalType> unnamed_children;
	auto &children = StructType::GetChildTypes(arguments[0]->return_type);
	unnamed_children.reserve(children.size());
	for (auto &child : children) {
		unnamed_children.emplace_back("", child.second);
	}
	bound_function.SetReturnType(LogicalType::STRUCT(unnamed_children));
	return nullptr;
}

ScalarFunction StructValuesFun::GetFunction() {
	ScalarFunction func({LogicalType::ANY}, LogicalTypeId::STRUCT, StructValuesFunction, StructValuesBind);
	func.SetNullHandling(FunctionNullHandling::SPECIAL_HANDLING);
	return func;
}

} // namespace duckdb


Review comment (suggestion):
Can you make the case for using SPECIAL_HANDLING?
Perhaps have a look at the comments on this enum, because I think this resembles the "default" handling

Code after:
		if (!input_data.validity.AllValid()) {
			auto &validity = FlatVector::Validity(result);

			for (idx_t i = 0; i < count; i++) {
				auto idx = input_data.sel->get_index(i);
				if (!input_data.validity.RowIsValid(idx)) {
					validity.SetInvalid(i);
				}
			}
		}
	}
}

// Ensure input is a STRUCT, set return type to an unnamed STRUCT with same child types
static unique_ptr<FunctionData> StructValuesBind(ClientContext &context, ScalarFunction &bound_function,
                                                 vector<unique_ptr<Expression>> &arguments) {
	const auto arg_type = arguments[0]->return_type;
	if (arg_type == LogicalTypeId::UNKNOWN) {
		throw ParameterNotResolvedException();
	}

	// Since the type of the argument we declared of in `GetFunction` doesn't contain the inner STRUCT type,
	// we should take it from the arguments
	bound_function.arguments[0] = arg_type;

	// Build unnamed children list using only types, with empty names
	child_list_t<LogicalType> unnamed_children;
	auto &children = StructType::GetChildTypes(arguments[0]->return_type);
	unnamed_children.reserve(children.size());
	for (auto &child : children) {
		unnamed_children.emplace_back("", child.second);
	}
	bound_function.SetReturnType(LogicalType::STRUCT(unnamed_children));
	return nullptr;
}

ScalarFunction StructValuesFun::GetFunction() {
	ScalarFunction func({LogicalTypeId::STRUCT}, LogicalTypeId::STRUCT, StructValuesFunction, StructValuesBind);
	return func;
}

} // namespace duckdb
Repository: duckdb/duckdb
File: extension/core_functions/scalar/struct/struct_values.cpp (C++)

Code before:
#include "duckdb/common/types/vector.hpp"
#include "duckdb/execution/expression_executor_state.hpp"
#include "duckdb/function/scalar/nested_functions.hpp" // VariableReturnBindData
#include "core_functions/scalar/struct_functions.hpp"

namespace duckdb {

static void StructValuesFunction(DataChunk &args, ExpressionState &state, Vector &result) {
	D_ASSERT(args.ColumnCount() == 1);
	auto &input = args.data[0];
	const idx_t count = args.size();

	auto &input_children = StructVector::GetEntries(input);
	auto &result_children = StructVector::GetEntries(result);
	D_ASSERT(result_children.size() == input_children.size());

	// We would use result.Reference(input) here, but that function asserts that the logical types are the same
	// UnnamedStruct vector and Struct vector are actually the same underneath, so we can just reference the children
	for (idx_t i = 0; i < input_children.size(); i++) {
		result_children[i]->Reference(*input_children[i]);
	}

	if (input.GetVectorType() == VectorType::CONSTANT_VECTOR) {
		result.SetVectorType(VectorType::CONSTANT_VECTOR);
		const bool is_null = ConstantVector::IsNull(input);
		ConstantVector::SetNull(result, is_null);
	} else {
		result.SetVectorType(VectorType::FLAT_VECTOR);

		// Make result validity to mirror input's nulls
		UnifiedVectorFormat input_data;
		input.ToUnifiedFormat(count, input_data);
		auto &validity = FlatVector::Validity(result);

		validity.EnsureWritable();

Review comment (suggestion):
Since we accept unnamed structs, we could have an early out for that case, by detecting the `StructType::IsUnnamed(input.GetType())` and just directly referencing the input

Code after:
#include "duckdb/common/types/vector.hpp"
#include "duckdb/execution/expression_executor_state.hpp"
#include "duckdb/function/scalar/nested_functions.hpp" // VariableReturnBindData
#include "core_functions/scalar/struct_functions.hpp"

namespace duckdb {

static void StructValuesFunction(DataChunk &args, ExpressionState &state, Vector &result) {
	D_ASSERT(args.ColumnCount() == 1);
	auto &input = args.data[0];
	const idx_t count = args.size();

	auto &input_children = StructVector::GetEntries(input);
	auto &result_children = StructVector::GetEntries(result);
	D_ASSERT(result_children.size() == input_children.size());

	// UnnamedStruct vector and Struct vector are actually the same underneath, so we can just reference the children
	if (StructType::IsUnnamed(input.GetType())) {
		result.Reference(input);
		return;
	}

	// We would use result.Reference(input) also for this case,
	// but that function asserts that the logical types are the same
	for (idx_t i = 0; i < input_children.size(); i++) {
		result_children[i]->Reference(*input_children[i]);
	}

	if (input.GetVectorType() == VectorType::CONSTANT_VECTOR) {
		result.SetVectorType(VectorType::CONSTANT_VECTOR);
		const bool is_null = ConstantVector::IsNull(input);
		ConstantVector::SetNull(result, is_null);
	} else {
		result.SetVectorType(VectorType::FLAT_VECTOR);
Repository: duckdb/duckdb
File: tools/shell/shell_renderer.cpp (C++)

Code before:
	case RenderMode::PRETTY:
		return make_uniq<ModePrettyRenderer>(*this);
	case RenderMode::COLUMN:
		return make_uniq<ModeColumnRenderer>(*this);
	case RenderMode::TABLE:
		return make_uniq<ModeTableRenderer>(*this);
	case RenderMode::MARKDOWN:
		return make_uniq<ModeMarkdownRenderer>(*this);
	case RenderMode::BOX:
		return make_uniq<ModeBoxRenderer>(*this);
	case RenderMode::LATEX:
		return make_uniq<ModeLatexRenderer>(*this);
	case RenderMode::DUCKBOX:
		return make_uniq<ModeDuckBoxRenderer>(*this);
	default:
		throw std::runtime_error("Unsupported mode for GetRenderer");
	}
}

//===--------------------------------------------------------------------===//
// Shell Logging Storage
//===--------------------------------------------------------------------===//

void ShellLogStorage::WriteLogEntry(duckdb::timestamp_t timestamp, duckdb::LogLevel level, const string &log_type,
                                    const string &log_message, const duckdb::RegisteredLoggingContext &context) {
	shell_highlight.PrintText("Warning:\n", PrintOutput::STDOUT, HighlightElementType::WARNING);
	shell_highlight.PrintText(log_message + "\n\n", PrintOutput::STDOUT, HighlightElementType::NONE);
}

} // namespace duckdb_shell


Review comment (suggestion):
this should not hard-code `warning:` this depends on the log level passed as argument

Code after:
				// for numeric types emit the data directly without quoting
				out.Print(data[i]);
			} else {
				// not a nested type - escape here
				out.Print(EscapeJSONString(data[i].GetString()));
			}
		}
		out.Print("}");
	}

	string EscapeJSONString(const string &str) {
		string result = "\"";
		for (auto c_ : str) {
			auto c = (unsigned char)c_;
			if (c == '\\' || c == '"') {
				// escape \ and "
				result += "\\";
				result += c_;
			} else if (c <= 0x1f) {
				result += "\\";
				if (c == '\b') {
					result += "b";
				} else if (c == '\f') {
					result += "f";
				} else if (c == '\n') {
					result += "n";
				} else if (c == '\r') {
					result += "r";
				} else if (c == '\t') {
					result += "t";
				} else {
					char buf[10];
					snprintf(buf, 10, "u%04x", c);
					result += buf;
				}
			} else {
				result += c_;
			}
		}
		result += "\"";
		return result;
	}

	static bool RequiresJSONCast(const duckdb::LogicalType &type) {
		if (type.IsNested()) {
			// cast nested types to JSON to preserve structure
			return true;
		}
		if (type.IsFloating()) {
			// cast floating point numbers to JSON to correctly deal with inf / nan
			return true;
Repository: duckdb/duckdb
File: extension/core_functions/scalar/string/parse_formatted_bytes.cpp (C++)

Code before:
#include "duckdb/function/scalar_function.hpp"

#include <core_functions/scalar/string_functions.hpp>

namespace duckdb {
static void PraseFormattedBytesFunction(DataChunk &args, ExpressionState &state, Vector &result) {
	auto arg0 = args.data[0];
	UnaryExecutor::Execute<string_t, idx_t>(arg0, result, args.size(), [&](string_t str) {
		// Invalid input exceptions thrown from ParseMemoryLimit won't be handled but will be thrown as is
		return StringUtil::ParseFormattedBytes(str.GetString());
	});
}

static void TryParseFormattedBytesFunction(DataChunk &args, ExpressionState &state, Vector &result) {
	auto arg0 = args.data[0];

	UnaryExecutor::ExecuteWithNulls<string_t, idx_t>(arg0, result, args.size(),
	                                                 [&](string_t str, ValidityMask &mask, idx_t index) {
		                                                 try {
			                                                 return StringUtil::ParseFormattedBytes(str.GetString());
		                                                 } catch (const Exception &) {
			                                                 mask.SetInvalid(index);
			                                                 return static_cast<idx_t>(0);
		                                                 }
	                                                 });
}

ScalarFunction ParseFormattedBytesFun::GetFunction() {
	return ScalarFunction({LogicalType::VARCHAR}, LogicalType::UBIGINT, PraseFormattedBytesFunction);
}

ScalarFunction TryParseFormattedBytesFun::GetFunction() {
	return ScalarFunction({LogicalType::VARCHAR}, LogicalType::UBIGINT, TryParseFormattedBytesFunction);
}

} // namespace duckdb


Review comment (suggestion):
I think we should be able to remove the `try/catch` here now and set `NULL` based on `string.empty()` when using `TryParseFormattedBytes`.

Code after:
#include "duckdb/function/scalar_function.hpp"

#include "core_functions/scalar/string_functions.hpp"

namespace duckdb {
static void ParseFormattedBytesFunction(DataChunk &args, ExpressionState &state, Vector &result) {
	auto arg0 = args.data[0];
	UnaryExecutor::Execute<string_t, idx_t>(arg0, result, args.size(), [&](string_t str) {
		// Invalid input exceptions thrown from ParseFormattedBytes won't be handled but will be thrown as is
		return StringUtil::ParseFormattedBytes(str.GetString());
	});
}

ScalarFunction ParseFormattedBytesFun::GetFunction() {
	return ScalarFunction({LogicalType::VARCHAR}, LogicalType::UBIGINT, ParseFormattedBytesFunction);
}
} // namespace duckdb
Repository: duckdb/duckdb
File: extension/core_functions/scalar/string/parse_formatted_bytes.cpp (C++)

Code before:
#include "duckdb/function/scalar_function.hpp"

#include <core_functions/scalar/string_functions.hpp>

namespace duckdb {
static void PraseFormattedBytesFunction(DataChunk &args, ExpressionState &state, Vector &result) {
	auto arg0 = args.data[0];
	UnaryExecutor::Execute<string_t, idx_t>(arg0, result, args.size(), [&](string_t str) {
		// Invalid input exceptions thrown from ParseMemoryLimit won't be handled but will be thrown as is
		return StringUtil::ParseFormattedBytes(str.GetString());
	});
}

static void TryParseFormattedBytesFunction(DataChunk &args, ExpressionState &state, Vector &result) {
	auto arg0 = args.data[0];

	UnaryExecutor::ExecuteWithNulls<string_t, idx_t>(
	    arg0, result, args.size(), [&](string_t str, ValidityMask &mask, idx_t index) {
		    idx_t parsing_result;
		    string error = StringUtil::TryParseFormattedBytes(str.GetString(), parsing_result);
		    if (!error.empty()) {
			    mask.SetInvalid(index);
			    return static_cast<idx_t>(0);
		    }
		    return parsing_result;
	    });
}


Review comment (suggestion):
Nit: non-STL includes should be in quotes, i.e.:
```C++
#include "core_functions/scalar/string_functions.hpp"
```

Code after:
#include "duckdb/function/scalar_function.hpp"

#include "core_functions/scalar/string_functions.hpp"

namespace duckdb {
static void ParseFormattedBytesFunction(DataChunk &args, ExpressionState &state, Vector &result) {
	auto arg0 = args.data[0];
	UnaryExecutor::Execute<string_t, idx_t>(arg0, result, args.size(), [&](string_t str) {
		// Invalid input exceptions thrown from ParseFormattedBytes won't be handled but will be thrown as is
		return StringUtil::ParseFormattedBytes(str.GetString());
	});
}

ScalarFunction ParseFormattedBytesFun::GetFunction() {
	return ScalarFunction({LogicalType::VARCHAR}, LogicalType::UBIGINT, ParseFormattedBytesFunction);
}
} // namespace duckdb
Repository: duckdb/duckdb
File: tools/shell/shell.cpp (C++)

Code before:
			result += "\\\"";
		} else if (c == '\t') {
			result += "\\t";
		} else if (c == '\n') {
			result += "\\n";
		} else if (c == '\r') {
			result += "\\r";
		} else if (!isprint(c & 0xff)) {
			result += "\\";
			char buf[4];
			snprintf(buf, 4, "%03o", c & 0xFF);
			result += buf;
		} else {
			result += c;
		}
	}
	result += "\"";
	return result;
}

/**
 ** Uses non-buffered output calls (that are also signal-safe) to print the message.
 */
static void PrintCtrlDHint() {
	string msg = "Interrupted, use Ctrl+D to exit\n";
#if (defined(_WIN32) || defined(WIN32)) && !defined(_WIN32_WCE)
	HANDLE hc = GetStdHandle(STD_ERROR_HANDLE);
	if (hc == INVALID_HANDLE_VALUE) {
		return;
	}
	auto status = WriteConsoleA(hc, msg.c_str(), static_cast<DWORD>(msg.length()), nullptr, nullptr);
	(void)status;
#else  // !_WIN32
	auto written = write(STDERR_FILENO, msg.c_str(), msg.length());
	(void)written;
#endif // _WIN32
}

/*
** This routine runs when the user presses Ctrl-C
*/
static void interrupt_handler(int NotUsed) {
	UNUSED_PARAMETER(NotUsed);
	auto &state = ShellState::Get();
	state.seenInterrupt++;
	if (state.seenInterrupt > 2) {
		exit(1);
	}
	if (state.conn) {
		state.conn->Interrupt();
	}

Review comment (suggestion):
Now that this is no longer happening during a signal we can just use `Print()`

Code after:
			result += "\\\"";
		} else if (c == '\t') {
			result += "\\t";
		} else if (c == '\n') {
			result += "\\n";
		} else if (c == '\r') {
			result += "\\r";
		} else if (!isprint(c & 0xff)) {
			result += "\\";
			char buf[4];
			snprintf(buf, 4, "%03o", c & 0xFF);
			result += buf;
		} else {
			result += c;
		}
	}
	result += "\"";
	return result;
}

/*
** This routine runs when the user presses Ctrl-C
*/
static void interrupt_handler(int NotUsed) {
	UNUSED_PARAMETER(NotUsed);
	auto &state = ShellState::Get();
	state.seenInterrupt++;
	if (state.seenInterrupt > 2) {
		exit(1);
	}
	if (state.conn) {
		state.conn->Interrupt();
	}
}

#if (defined(_WIN32) || defined(WIN32)) && !defined(_WIN32_WCE)
/*
** This routine runs for console events (e.g. Ctrl-C) on Win32
*/
static BOOL WINAPI ConsoleCtrlHandler(DWORD dwCtrlType /* One of the CTRL_*_EVENT constants */
) {
	if (dwCtrlType == CTRL_C_EVENT) {
		interrupt_handler(0);
		return TRUE;
	}
	return FALSE;
}
#endif

string ShellState::GetSchemaLine(const string &str, const string &tail) {
	return str + tail;