Skip to content

#62489: dba_insert not working as expected - #125

Closed
marc-mabe wants to merge 1 commit into
php:masterfrom
marc-mabe:bug62489
Closed

marc-mabe wants to merge 1 commit into
php:masterfrom
marc-mabe:bug62489

Conversation

@marc-mabe

Copy link
Copy Markdown
Contributor

removed warnings if dba_insert failed because of an already existing key.

fixed handlers are:

  • flatfile
  • gdbm
  • inifile
  • qdbm

@smalyshev

Copy link
Copy Markdown
Contributor

Please add a test.

@marc-mabe

Copy link
Copy Markdown
Contributor Author

@smalyshev: Tests added now

The test for the inifile handler fails because this handler insert items even if the item already exists.
I removed the waring "Key already exists" within DBA_UPDATE_FUNC(inifile) but the switch case never occur because inifile_append doesn't implement such functionality.

I'm not a C developer so it would be the best merging this but leaving the bug open so another person can fix it.

@marc-mabe

Copy link
Copy Markdown
Contributor Author

Hello guys, is there someone could review this ?

Comment thread ext/dba/dba_gdbm.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Indenting is wrong here.

@lstrojny

lstrojny commented Jan 6, 2013

Copy link
Copy Markdown
Contributor

@marc-mabe sorry for the long delay. Please fix the coding style issues after that it looks good for merge.

@marc-mabe

Copy link
Copy Markdown
Contributor Author

@lstrojny : thank you for review! Updated coding style issues now

Comment thread ext/dba/dba_gdbm.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is this really correct? Shouldn’t be the default case just throw some error?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The default case should be impossible - it was copied from DBA_UPDATE_FUNC(flatfile)

  • What should the message say on this case ?
  • "Unknown return value %value% by %lib-function%" ?
  • error, warning or notice?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"Unknown return value" is fine. Warning seems appropriate to me.

@lstrojny

Copy link
Copy Markdown
Contributor

After fixing the switch case, could you rebase and squash?

…ected handlers are flatfile, inifile, qdbm and gdbm)
@marc-mabe

Copy link
Copy Markdown
Contributor Author

done! - updated the switch statements and squashed all commits together

Comment thread ext/dba/dba_qdbm.c

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Trailing spaces

@lstrojny

Copy link
Copy Markdown
Contributor

Merged into 5.5 and master. Cannot close it now as GitHub seems to be in trouble.

@php-pulls

Copy link
Copy Markdown

Comment on behalf of lstrojny at php.net:

Merged

@php-pulls php-pulls closed this Jan 15, 2013
heyJordanParker added a commit to heyJordanParker/php-sharp that referenced this pull request Oct 11, 2026
SHARP_MAGO_COMMIT named the head of Mago php#125 while it was under review.
php#125 merged, so the pin now names its merge commit on Mago master. That
commit also words an Any comparison operand in PHP#'s words in a .sharp
file. The header it generates differs from this one only in the pin.

ext/sharp/
└── sharp_unit.h                             <- SHARP_MAGO_COMMIT pins Mago 449377a, the merge of php#125
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

Successfully merging this pull request may close these issues.

4 participants