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

json_array columns should return null for null values #655

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants
@wildlyinaccurate

wildlyinaccurate commented Aug 6, 2014

I guess this is a BC-break, but it fixes DBAL-446.

@doctrinebot

This comment has been minimized.

Show comment
Hide comment
@doctrinebot

doctrinebot Aug 6, 2014

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-966

We use Jira to track the state of pull requests and the versions they got
included in.

doctrinebot commented Aug 6, 2014

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-966

We use Jira to track the state of pull requests and the versions they got
included in.

@Ocramius

This comment has been minimized.

Show comment
Hide comment
@Ocramius

Ocramius Aug 6, 2014

Member

Can't accept this bc break in 2.x, sorry.

Member

Ocramius commented Aug 6, 2014

Can't accept this bc break in 2.x, sorry.

@Ocramius Ocramius closed this Aug 6, 2014

@wildlyinaccurate

This comment has been minimized.

Show comment
Hide comment
@wildlyinaccurate

wildlyinaccurate Aug 6, 2014

That sucks, since it was marked as resolved in 2.3.3... What's the workaround then, a custom data type?

wildlyinaccurate commented Aug 6, 2014

That sucks, since it was marked as resolved in 2.3.3... What's the workaround then, a custom data type?

@Ocramius

This comment has been minimized.

Show comment
Hide comment
@Ocramius

Ocramius Aug 6, 2014

Member

@wildlyinaccurate yep, for now, that's the solution :-\

Member

Ocramius commented Aug 6, 2014

@wildlyinaccurate yep, for now, that's the solution :-\

@Ocramius Ocramius self-assigned this Aug 6, 2014

@deeky666

This comment has been minimized.

Show comment
Hide comment
@deeky666

deeky666 Aug 6, 2014

Member

@wildlyinaccurate it is marked as resolved in 2.3.3 indeed but if you have a look at JsonArrayType in the 2.3.3 tag you will notice that the behaviours was the same as it is now. It still returns array() instead of null. As we unfortunately don't have a reference commit, I assume this was a misunderstanding of some kind.

Member

deeky666 commented Aug 6, 2014

@wildlyinaccurate it is marked as resolved in 2.3.3 indeed but if you have a look at JsonArrayType in the 2.3.3 tag you will notice that the behaviours was the same as it is now. It still returns array() instead of null. As we unfortunately don't have a reference commit, I assume this was a misunderstanding of some kind.

@frickenate

This comment has been minimized.

Show comment
Hide comment
@frickenate

frickenate Oct 20, 2014

Could we maybe get an additional "json" or "json_object" type? "json_array" is a poor name to begin with, as we can store non-array data as well. You can store a boolean, integer, float, or string just fine in a json_array column. The only problem is that when this type was added, the assumption was made that people would only use this to store arrays. I have a config-based table where the value column should be json, yet I can't use json_array because of this null bug. I guess I'm off to figure out my first custom type.

frickenate commented Oct 20, 2014

Could we maybe get an additional "json" or "json_object" type? "json_array" is a poor name to begin with, as we can store non-array data as well. You can store a boolean, integer, float, or string just fine in a json_array column. The only problem is that when this type was added, the assumption was made that people would only use this to store arrays. I have a config-based table where the value column should be json, yet I can't use json_array because of this null bug. I guess I'm off to figure out my first custom type.

@Ocramius

This comment has been minimized.

Show comment
Hide comment
@Ocramius

Ocramius Oct 20, 2014

Member

I guess I'm off to figure out my first custom type.

I'd suggest the same as well: if we introduce a new json type now, then it's just going to be even more messy

Member

Ocramius commented Oct 20, 2014

I guess I'm off to figure out my first custom type.

I'd suggest the same as well: if we introduce a new json type now, then it's just going to be even more messy

@frickenate

This comment has been minimized.

Show comment
Hide comment
@frickenate

frickenate Oct 20, 2014

For the next person to come here looking for answers, I've posted a blog entry with the custom Json data type.

frickenate commented Oct 20, 2014

For the next person to come here looking for answers, I've posted a blog entry with the custom Json data type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment