Skip to content

Commit

Permalink
fix(ci): flaky test (databendlabs#17149)
Browse files Browse the repository at this point in the history
* fix flaky test

* fix

fix
  • Loading branch information
zhyass authored and everpcpc committed Jan 7, 2025
1 parent c2402bd commit faa3f46
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion scripts/build/build-website.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd "$SCRIPT_PATH/../.." || exit
echo "Building docs"
cd website

# NOET: for aarch64 macos
# NOTE: for aarch64 macos
# arch -x86_64 zsh

mkdir -p ~/.nvm
Expand Down
2 changes: 1 addition & 1 deletion src/query/ast/src/parser/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ where
input.backtrace.clear();

let err_kind = match err {
PrattError::EmptyInput => ErrorKind::Other("expecting an oprand"),
PrattError::EmptyInput => ErrorKind::Other("expecting an operand"),
PrattError::UnexpectedNilfix(_) => ErrorKind::Other("unable to parse the element"),
PrattError::UnexpectedPrefix(_) => {
ErrorKind::Other("unable to parse the prefix operator")
Expand Down
4 changes: 2 additions & 2 deletions src/query/ast/tests/it/testdata/expr-error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error:
--> SQL:1:3
|
1 | 5 * (a and ) 1
| - ^ expecting an oprand
| - ^ expecting an operand
| |
| while parsing expression

Expand All @@ -17,7 +17,7 @@ error:
--> SQL:1:5
|
1 | a + +
| - ^ expecting an oprand
| - ^ expecting an operand
| |
| while parsing expression

Expand Down
2 changes: 1 addition & 1 deletion src/query/ast/tests/it/testdata/query-error.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error:
--> SQL:1:24
|
1 | select * from customer join where a = b
| ------ ^^^^ expecting an oprand
| ------ ^^^^ expecting an operand
| |
| while parsing `SELECT ...`

Expand Down
4 changes: 2 additions & 2 deletions src/query/script/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -724,14 +724,14 @@ impl Compiler {
fn compile_case(
&mut self,
span: Span,
oprand: &Expr,
operand: &Expr,
conditions: &[Expr],
results: &[Vec<ScriptStatement>],
else_result: &Option<Vec<ScriptStatement>>,
) -> Result<Vec<ScriptIR>> {
let conditions = conditions
.iter()
.map(|condition| wrap_eq(condition.span(), oprand.clone(), condition.clone()))
.map(|condition| wrap_eq(condition.span(), operand.clone(), condition.clone()))
.collect::<Vec<_>>();
self.compile_if(span, &conditions, results, else_result)
}
Expand Down
4 changes: 2 additions & 2 deletions src/query/sql/src/planner/binder/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ impl TableIdentifier {
QuotedIdent(&database.name, self.dialect.default_ident_quote())
)
}
Some(NameResolutionSuggest::Unqoted) => {
Some(NameResolutionSuggest::Unquoted) => {
format!(
"Unknown database {catalog}.{database} (quoted). Did you mean {} (unquoted)?",
&database.name
Expand All @@ -204,7 +204,7 @@ impl TableIdentifier {
QuotedIdent(&table.name, self.dialect.default_ident_quote())
)
}
Some(NameResolutionSuggest::Unqoted) => {
Some(NameResolutionSuggest::Unquoted) => {
format!(
"Unknown table {catalog}.{database}.{table} (quoted). Did you mean {} (unquoted)?",
&table.name
Expand Down
4 changes: 2 additions & 2 deletions src/query/sql/src/planner/semantic/name_resolution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub struct NameResolutionContext {

pub enum NameResolutionSuggest {
Quoted,
Unqoted,
Unquoted,
}

impl NameResolutionContext {
Expand All @@ -48,7 +48,7 @@ impl NameResolutionContext {
) {
(false, true, false) => Some(NameResolutionSuggest::Quoted),
(true, false, true) if !ident_needs_quote(&ident.name) => {
Some(NameResolutionSuggest::Unqoted)
Some(NameResolutionSuggest::Unquoted)
}
_ => None,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ query T
SELECT substr(DATE_ADD(month, 1, now())::String, 6, 2) =
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN '01'
ELSE (substr(now()::String, 6, 2)::int + 1)::String
ELSE LPAD((substr(now()::String, 6, 2)::int + 1)::String, 2, '0')
END;
----
1
Expand Down Expand Up @@ -950,7 +950,7 @@ query T
SELECT substr(DATE_ADD(month, 1, now())::String, 6, 2) =
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN '01'
ELSE (substr(now()::String, 6, 2)::int + 1)::String
ELSE LPAD((substr(now()::String, 6, 2)::int + 1)::String, 2, '0')
END;
----
1
Expand All @@ -960,7 +960,7 @@ query T
SELECT substr(DATE_ADD(month, 1, now())::String, 1, 4) =
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN (substr(now()::String, 1,4)::int+1)::String
ELSE (substr(now()::String, 6, 2)::int + 1)::String
ELSE (substr(now()::String, 1, 4)::int)::String
END;
----
1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ query T
SELECT substr(DATE_ADD(month, 1, now())::String, 6, 2) =
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN '01'
ELSE (substr(now()::String, 6, 2)::int + 1)::String
ELSE LPAD((substr(now()::String, 6, 2)::int + 1)::String, 2, '0')
END;
----
1
Expand All @@ -769,7 +769,7 @@ query T
SELECT substr(DATE_ADD(month, 1, now())::String, 1, 4) =
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN (substr(now()::String, 1,4)::int+1)::String
ELSE (substr(now()::String, 6, 2)::int + 1)::String
ELSE (substr(now()::String, 1, 4)::int)::String
END;
----
1
Expand Down Expand Up @@ -813,7 +813,7 @@ query T
SELECT substr(DATE_ADD(month, 1, now())::String, 6, 2) =
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN '01'
ELSE (substr(now()::String, 6, 2)::int + 1)::String
ELSE LPAD((substr(now()::String, 6, 2)::int + 1)::String, 2, '0')
END;
----
1
Expand All @@ -823,7 +823,7 @@ query T
SELECT substr(DATE_ADD(month, 1, now())::String, 1, 4) =
CASE
WHEN substr(now()::String, 6, 2) = '12' THEN (substr(now()::String, 1,4)::int+1)::String
ELSE (substr(now()::String, 6, 2)::int + 1)::String
ELSE (substr(now()::String, 1, 4)::int)::String
END;
----
1
Expand Down

0 comments on commit faa3f46

Please sign in to comment.