From 63f5592ecffec67be4591eb96a13dc6b3194843a Mon Sep 17 00:00:00 2001 From: Ryan Leckey Date: Wed, 18 Mar 2020 16:25:10 -0700 Subject: [PATCH] postgres: be explicit about an expression type for a test --- sqlx-test/src/lib.rs | 2 +- tests/postgres-types.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sqlx-test/src/lib.rs b/sqlx-test/src/lib.rs index 4cc9295a..d064371b 100644 --- a/sqlx-test/src/lib.rs +++ b/sqlx-test/src/lib.rs @@ -119,6 +119,6 @@ macro_rules! Sqlite_query_for_test_prepared_type { #[macro_export] macro_rules! Postgres_query_for_test_prepared_type { () => { - "SELECT {0} is not distinct from $1, $2::text as _1, {0}, $3 as _3" + "SELECT {0} is not distinct from $1, $2::text as _1, {0} as _2, $3 as _3" }; } diff --git a/tests/postgres-types.rs b/tests/postgres-types.rs index 8752fb4e..9a4fc69b 100644 --- a/tests/postgres-types.rs +++ b/tests/postgres-types.rs @@ -141,7 +141,7 @@ mod chrono { test_type!(chrono_date_time( Postgres, NaiveDateTime, - "'2019-01-02 05:10:20'" == NaiveDate::from_ymd(2019, 1, 2).and_hms(5, 10, 20) + "'2019-01-02 05:10:20'::timestamp" == NaiveDate::from_ymd(2019, 1, 2).and_hms(5, 10, 20) )); test_type!(chrono_date_time_tz( @@ -256,7 +256,7 @@ DO $$ BEGIN CREATE TYPE _sqlx_record_1 AS (_1 int8); EXCEPTION WHEN duplicate_object THEN null; -END $$; +END $$; "#, ) .await?;