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

fix yajra#882 - Due to conflict previous changes were reverted, synchronized repo. #888

Open
wants to merge 2 commits into
base: 10.x
Choose a base branch
from

Conversation

Sudheert7
Copy link

@Sudheert7 Sudheert7 commented Sep 5, 2024

Due to conflict previous changes were reverted, synchronized repo.
fix #882

@Sudheert7 Sudheert7 changed the title Fixed #885 - Due to conflict previous changes were reverted, synchronized repo. fix yajra#882 - Due to conflict previous changes were reverted, synchronized repo. Sep 5, 2024
@yajra
Copy link
Owner

yajra commented Sep 6, 2024

I think this change will not execute the sequence syntax and will just return a string instead:

Example raw SQL

select 'users_id_seq.currval' as "id" from dual;

Output

"id"
users_id_seq.currval

@Sudheert7
Copy link
Author

fixed, line 154 reverted

create  sequence users_id_seq start with 1 increment by 1 nocycle cache 2;
select  users_id_seq.currval,users_id_seq.nextval  from dual;

Output:

CURRVAL NEXTVAL
1 1

@@ -122,7 +122,7 @@ public function nextValue($name)

$name = $this->wrap($name);

return $this->connection->selectOne("SELECT $name.NEXTVAL as \"id\" FROM DUAL")->id;
return $this->connection->selectOne("SELECT '$name.NEXTVAL' as \"id\" FROM DUAL")->id;
Copy link
Owner

Choose a reason for hiding this comment

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

The single quote here is unnecessary and it will produce a bad SQL syntax.

@yajra
Copy link
Owner

yajra commented Sep 9, 2024

Can you please provide snippets to reproduce the issue that is being fixed in this PR? Thanks!

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.

2 participants