CodeIgniter4 icon indicating copy to clipboard operation
CodeIgniter4 copied to clipboard

Bug: Database session handler using postgres

Open githaigamaina opened this issue 3 years ago • 2 comments

PHP Version

7.4

CodeIgniter4 Version

4.1.7

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

PostgreSQL14

What happened?

If the session handle is database, it throwing an error.

Steps to Reproduce

Install CI4 and use PostreSQL as the database Set the session handler to database

Expected Output

The system will use database sessions without breaking. I have to change change Vendor > Codeigniter4 >- framework > Session > Handlers > DatabaseHandler.php line line 122 to

->select($this->platform === 'postgre' ? "encode(data, 'base64') AS data" : 'data')

to

change Vendor > Codeigniter4 >- framework > Session > Handlers > DatabaseHandler.php line line 122 to

->select($this->platform === 'postgre' ? "encode(data::bytea, 'base64') AS data" : 'data')

Anything else?

I have given my solution as above.

githaigamaina avatar Jan 13 '22 12:01 githaigamaina

@githaigamaina Thank you for reporting! Why don't you send a PR? See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/README.md

kenjis avatar Jan 13 '22 23:01 kenjis

Can't reproduce on develop and postgres:13-alpine, PHP 8.0.15.

Can't reproduce onpostgres:14-alpine.

kenjis avatar Feb 15 '22 01:02 kenjis

It seems there is no activity for this, and not reproducible. Closing.

paulbalandan avatar Nov 10 '22 08:11 paulbalandan