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

Bug: subquery runs create twice #4035

Closed
2 tasks done
EllisVerhoest opened this issue May 14, 2024 · 0 comments · Fixed by #4051
Closed
2 tasks done

Bug: subquery runs create twice #4035

EllisVerhoest opened this issue May 14, 2024 · 0 comments · Fixed by #4051
Assignees
Labels
bug Something isn't working

Comments

@EllisVerhoest
Copy link

EllisVerhoest commented May 14, 2024

Describe the bug

A CREATE subquery causes the document to be created twice

Steps to reproduce

DELETE FROM person,address;

CREATE ONLY person CONTENT {
	address: (CREATE ONLY address CONTENT {
		city: "Whiterun"
	})
};

SELECT * FROM person;
SELECT * FROM address;
-------- Query 1 (286.108µs) --------

[]

-------- Query 2 (654.175µs) --------

{
	address: {
		city: 'Whiterun',
		id: address:omd5nanwq9tb21ebrtoq
	},
	id: person:0au96ptpf4t38j53ixfn
}

-------- Query 3 (82.009µs) --------

[
	{
		address: {
			city: 'Whiterun',
			id: address:omd5nanwq9tb21ebrtoq
		},
		id: person:0au96ptpf4t38j53ixfn
	}
]

-------- Query 4 (61.151µs) --------

[
	{
		city: 'Whiterun',
		id: address:8z0fei97lju8f9b7wwi1
	},
	{
		city: 'Whiterun',
		id: address:omd5nanwq9tb21ebrtoq
	}
]

Expected behaviour

The subquery create should only create one address document.

SurrealDB version

2.0.0+20240513.1c09e18 for linux on x86_64

Contact Details

ellis.v@aspirecomps.co.uk

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@EllisVerhoest EllisVerhoest added bug Something isn't working triage This issue is new labels May 14, 2024
@EllisVerhoest EllisVerhoest changed the title Bug: create subquery of another create, creates 2x sub documents Bug: subquery runs create twice May 14, 2024
@tobiemh tobiemh self-assigned this May 15, 2024
@tobiemh tobiemh removed the triage This issue is new label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants