-
Notifications
You must be signed in to change notification settings - Fork 30
[bugfix] #47 Malformed UTF-8 characters, possibly incorrectly encoded #48
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
Merged
Naktibalda
merged 1 commit into
Codeception:master
from
cybd:47-Malformed-UTF-8-characters-possibly-incorrectly-encoded
Mar 18, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ insert into `groups`(`id`,`name`,`enabled`,`created_at`) values (2,'jazzman',0, | |
|
|
||
| CREATE TABLE `users` ( | ||
| `id` int(11) NOT NULL AUTO_INCREMENT, | ||
| `uuid` binary(16) DEFAULT NULL, | ||
| `name` varchar(30) DEFAULT NULL, | ||
| `email` varchar(255) DEFAULT NULL, | ||
| `is_active` bit(1) DEFAULT b'1', | ||
|
|
@@ -24,13 +25,13 @@ CREATE TABLE `users` ( | |
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
|
|
||
|
|
||
| insert into `users`(`id`,`name`,`email`, `is_active`,`created_at`) values (1,'davert','[email protected]', b'1','2012-02-01 21:17:04'); | ||
| insert into `users`(`id`,`uuid`, `name`,`email`, `is_active`,`created_at`) values (1,0x11edc34b01d972fa9c1d0242ac120006,'davert','[email protected]', b'1','2012-02-01 21:17:04'); | ||
|
|
||
| insert into `users`(`id`,`name`,`email`, `is_active`,`created_at`) values (2,'nick','[email protected]', b'1','2012-02-01 21:17:15'); | ||
| insert into `users`(`id`,`uuid`, `name`,`email`, `is_active`,`created_at`) values (2,null,'nick','[email protected]', b'1','2012-02-01 21:17:15'); | ||
|
|
||
| insert into `users`(`id`,`name`,`email`, `is_active`,`created_at`) values (3,'miles','[email protected]', b'1','2012-02-01 21:17:25'); | ||
| insert into `users`(`id`,`uuid`, `name`,`email`, `is_active`,`created_at`) values (3,null,'miles','[email protected]', b'1','2012-02-01 21:17:25'); | ||
|
|
||
| insert into `users`(`id`,`name`,`email`, `is_active`,`created_at`) values (4,'bird','[email protected]', b'0','2012-02-01 21:17:39'); | ||
| insert into `users`(`id`,`uuid`, `name`,`email`, `is_active`,`created_at`) values (4,null,'bird','[email protected]', b'0','2012-02-01 21:17:39'); | ||
|
|
||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ SET default_with_oids = false; | |
| DROP TABLE IF EXISTS users CASCADE; | ||
| CREATE TABLE users ( | ||
| name character varying(30), | ||
| uuid bytea, | ||
| email character varying(50), | ||
| created_at timestamp without time zone DEFAULT now(), | ||
| id integer NOT NULL | ||
|
|
@@ -181,6 +182,7 @@ ALTER SEQUENCE permissions_id_seq OWNED BY permissions.id; | |
| DROP TABLE IF EXISTS users CASCADE; | ||
| CREATE TABLE users ( | ||
| name character varying(30), | ||
| uuid bytea, | ||
| email character varying(50), | ||
| created_at timestamp without time zone DEFAULT now(), | ||
| id integer NOT NULL | ||
|
|
@@ -332,11 +334,11 @@ SELECT pg_catalog.setval('permissions_id_seq', 10, true); | |
| -- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: - | ||
| -- | ||
|
|
||
| COPY users (name, email, created_at, id) FROM stdin; | ||
| davert [email protected] \N 1 | ||
| nick [email protected] 2012-02-02 22:30:31.748 2 | ||
| miles [email protected] 2012-02-02 22:30:52.166 3 | ||
| bird [email protected] 2012-02-02 22:32:13.107 4 | ||
| COPY users (name, uuid, email, created_at, id) FROM stdin; | ||
| davert \\x11edc34b01d972fa9c1d0242ac120006 [email protected] \N 1 | ||
| nick NULL [email protected] 2012-02-02 22:30:31.748 2 | ||
| miles NULL [email protected] 2012-02-02 22:30:52.166 3 | ||
| bird NULL [email protected] 2012-02-02 22:32:13.107 4 | ||
| \. | ||
|
|
||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,11 +11,11 @@ INSERT INTO "permissions" VALUES(5,3,2,'member'); | |
| INSERT INTO "permissions" VALUES(7,4,2,'admin'); | ||
|
|
||
| DROP TABLE IF EXISTS "users"; | ||
| CREATE TABLE "users" ("name" VARCHAR, "email" VARCHAR, "created_at" DATETIME DEFAULT CURRENT_TIMESTAMP); | ||
| INSERT INTO "users" VALUES('davert','[email protected]','2012-02-01 21:17:04'); | ||
| INSERT INTO "users" VALUES('nick','[email protected]','2012-02-01 21:17:15'); | ||
| INSERT INTO "users" VALUES('miles','[email protected]','2012-02-01 21:17:25'); | ||
| INSERT INTO "users" VALUES('bird','[email protected]','2012-02-01 21:17:39'); | ||
| CREATE TABLE "users" ("name" VARCHAR, "uuid" BLOB DEFAULT NULL, "email" VARCHAR, "created_at" DATETIME DEFAULT CURRENT_TIMESTAMP); | ||
| INSERT INTO "users" VALUES('davert',X'11edc34b01d972fa9c1d0242ac120006','[email protected]','2012-02-01 21:17:04'); | ||
| INSERT INTO "users" VALUES('nick',null,'[email protected]','2012-02-01 21:17:15'); | ||
| INSERT INTO "users" VALUES('miles',null,'[email protected]','2012-02-01 21:17:25'); | ||
| INSERT INTO "users" VALUES('bird',null,'[email protected]','2012-02-01 21:17:39'); | ||
|
|
||
| DROP TABLE IF EXISTS "empty_table"; | ||
| CREATE TABLE "empty_table" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , "field" VARCHAR); | ||
|
|
||
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -64,20 +64,27 @@ public function testConnectionIsKeptForTheWholeSuite() | |
| $this->module->_afterSuite(); | ||
| } | ||
|
|
||
| public function testSeeInDatabaseWithBinary() | ||
| { | ||
| $this->module->seeInDatabase('users', ['uuid' => hex2bin('11edc34b01d972fa9c1d0242ac120006')]); | ||
| } | ||
|
|
||
| public function testSeeInDatabase() | ||
| { | ||
| $this->module->seeInDatabase('users', ['name' => 'davert']); | ||
| } | ||
|
|
||
| public function testCountInDatabase() | ||
| { | ||
| $this->module->seeNumRecords(1, 'users', ['uuid' => hex2bin('11edc34b01d972fa9c1d0242ac120006')]); | ||
| $this->module->seeNumRecords(1, 'users', ['name' => 'davert']); | ||
| $this->module->seeNumRecords(0, 'users', ['name' => 'davert', 'email' => '[email protected]']); | ||
| $this->module->seeNumRecords(0, 'users', ['name' => 'user1']); | ||
| } | ||
|
|
||
| public function testDontSeeInDatabase() | ||
| { | ||
| $this->module->dontSeeInDatabase('users', ['uuid' => hex2bin('ffffffffffffffffffffffffffffffff')]); | ||
| $this->module->dontSeeInDatabase('users', ['name' => 'user1']); | ||
| } | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change leads to a type error if
$param === nullI just created #63 to fix this issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also if
$paramis a float. Filed issue #64 about that bug.