Skip to content

Commit 85477ac

Browse files
authoredNov 6, 2022
fix(p3): accept CRLF for sqllogictest, fix optimizer (#463)
* fix(p3): accept CRLF for sqllogictest, fix optimizer Signed-off-by: Alex Chi <[email protected]> * fix comments Signed-off-by: Alex Chi <[email protected]> Signed-off-by: Alex Chi <[email protected]>
1 parent f7db06f commit 85477ac

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed
 

‎.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.slt text eol=lf

‎src/include/catalog/column.h

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ class Column {
3434
* Non-variable-length constructor for creating a Column.
3535
* @param column_name name of the column
3636
* @param type type of the column
37-
* @param expr expression used to create this column
3837
*/
3938
Column(std::string column_name, TypeId type)
4039
: column_name_(std::move(column_name)), column_type_(type), fixed_length_(TypeSize(type)) {

‎src/optimizer/optimizer.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ auto Optimizer::EstimatedCardinality(const std::string &table_name) -> std::opti
2727
if (StringUtil::EndsWith(table_name, "_100k")) {
2828
return std::make_optional(100000);
2929
}
30+
if (StringUtil::EndsWith(table_name, "_50k")) {
31+
return std::make_optional(50000);
32+
}
3033
if (StringUtil::EndsWith(table_name, "_10k")) {
3134
return std::make_optional(10000);
3235
}

‎tools/sqllogictest/parser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ auto Tokenize(const std::string &str, char delimiter = ' ') -> std::vector<std::
3434
}
3535

3636
auto ParseInner(const std::string &filename, const std::string &script) -> std::vector<std::unique_ptr<Record>> {
37-
auto lines = StringUtil::Split(script, '\n');
37+
auto lines = StringUtil::Split(StringUtil::Replace(script, "\r\n", "\n"), '\n');
3838
std::vector<std::unique_ptr<Record>> records;
3939
auto line_iter = lines.cbegin();
4040
while (line_iter != lines.cend()) {

0 commit comments

Comments
 (0)