From 2804dc98259d2ea960602aca6b8e7fdc03c1758f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Houl=C3=A9?= <13155277+tomhoule@users.noreply.github.com> Date: Mon, 21 Aug 2023 13:59:03 +0200 Subject: [PATCH] se: test reproduction for CREATE DEFAULT introspection on mssql (#4147) We have multiple issues related to crashes with CREATE DEFAULT, but this one prompted this reproduction: https://github.com/prisma/prisma/issues/14208 We _cannot_ reproduce the crash, and the default is not introspected. So the bug is not confirmed. --- .../mssql/default_with_create_default.sql | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 schema-engine/sql-introspection-tests/tests/simple/mssql/default_with_create_default.sql diff --git a/schema-engine/sql-introspection-tests/tests/simple/mssql/default_with_create_default.sql b/schema-engine/sql-introspection-tests/tests/simple/mssql/default_with_create_default.sql new file mode 100644 index 000000000000..958123d60c6d --- /dev/null +++ b/schema-engine/sql-introspection-tests/tests/simple/mssql/default_with_create_default.sql @@ -0,0 +1,25 @@ +-- tags=mssql2017 + +CREATE TABLE a ( + id INT IDENTITY, + savings INT, + CONSTRAINT [A_pkey] PRIMARY KEY (id) +); + +EXEC('CREATE DEFAULT NEARLY_NOTHING AS 0'); +EXEC('sp_bindefault ''NEARLY_NOTHING'', ''a.savings'''); +/* +generator js { + provider = "prisma-client-js" +} + +datasource db { + provider = "sqlserver" + url = env("DATABASE_URL") +} + +model a { + id Int @id(map: "A_pkey") @default(autoincrement()) + savings Int? +} +*/