Skip to content

Change schema to enforce error #738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/default/data/doctrine-dbal.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public function executeQuery(Connection $conn, array $types, QueryCacheProfile $

$result = $conn->executeQuery('SELECT email, adaid FROM ada');
assertType('array{email: string, adaid: int<-32768, 32767>}|false', $result->fetchAssociative());

$result = $conn->executeQuery('SELECT pid FROM typemix');
assertType('array{pid: int<0, 4294967295>}|false', $result->fetchAssociative());
}

public function executeStatement(Connection $conn, int $adaid)
Expand Down
11 changes: 3 additions & 8 deletions tests/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ALTER TABLE `ak`


CREATE TABLE `typemix` (
`pid` int NOT NULL,
`pid` int unsigned NOT NULL AUTO_INCREMENT,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer adding a new column at the end of this table instead of changing a existing column.

Additionally we need the same schema change in the pgsql schema file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am still trying to reproduce my issue #737... At first I thought it was somehow related to the column being the primary key, for which reason I added it here. And even though there seems to be some inconsistencies here since it is already breaking some tests, it's not failing in the way I supposed it to 🙈 I think I have to continue to try reproducing this...

`c_char5` char(5) NOT NULL,
`c_varchar255` varchar(255) NOT NULL,
`c_varchar25` varchar(25) DEFAULT NULL,
Expand Down Expand Up @@ -70,15 +70,10 @@ CREATE TABLE `typemix` (
`c_json` json,
`c_json_not_null` json NOT NULL,
`c_decimal` decimal(12, 2),
`c_decimal_not_null` decimal(12, 2) NOT NULL
`c_decimal_not_null` decimal(12, 2) NOT NULL,
PRIMARY KEY(`pid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

ALTER TABLE `typemix`
ADD PRIMARY KEY (`pid`);

ALTER TABLE `typemix`
MODIFY `pid` int NOT NULL AUTO_INCREMENT;

CREATE TABLE `cmsdomain` (
`id` int(11) NOT NULL,
`cmsdomainid` int(11) NOT NULL,
Expand Down
Loading