Skip to content
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

sqlite: parseColumnType gives a warning #315

Closed
marcelklinek opened this issue Dec 23, 2024 · 2 comments
Closed

sqlite: parseColumnType gives a warning #315

marcelklinek opened this issue Dec 23, 2024 · 2 comments

Comments

@marcelklinek
Copy link

marcelklinek commented Dec 23, 2024

Version: 3.2.5

Bug Description

When I upgrade to 3.2.5 from 3.2.0 database layer starts throwing exceptions. I am using sqlite db with Database explorer.

First it gives a warning in parseColumnType:

Warning
Undefined array key 1

Then if skipped, throws a TypeError:

TypeError
strtoupper(): Argument # 1 ($string) must be of type string, null given

I attach a stack trace and table description.

Steps To Reproduce

A select/insert into sqlite both produce this error.

call_stack.txt

table_struct

Offering to help

I can try to prepare a PR if you point me in the right direction (very new to nette)

@dg
Copy link
Member

dg commented Dec 23, 2024

Can you dump what $row contains?

@marcelklinek
Copy link
Author

marcelklinek commented Dec 26, 2024

My bad, this is not a bug.

One of my tables (a different one) was missing a type on a column, which I discovered with dump($row);:

Nette\Database\Row
cid: 1
name: 'paid'
type: 'INTEGER'
notnull: 1
dflt_value: null
pk: 0

Nette\Database\Row
cid: 2
name: 'lead'
type: ''
notnull: 1
dflt_value: null
pk: 0

When I add the type it all works fine, sorry for false alarm.

Thanks for the pointer and for your work, David!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants