•  


Bug: Floats treated as integers and duplicate records not checked when floats used as record id · Issue #4069 · surrealdb/surrealdb · GitHub
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: Floats treated as integers and duplicate records not checked when floats used as record id #4069

Open
2 tasks done
Dhghomon opened this issue May 20, 2024 · 0 comments
Labels
bug Something isn't working triage This issue is new

Comments

@Dhghomon
Copy link
Contributor

Describe the bug

Floats are treated as ints for record ids, and

Steps to reproduce

CREATE person SET id = 9.8, name = 'Mr. 9.8';
CREATE person SET id = 9.8, name = 'Mr. 9.8';

The output will always be the same, and no error generated that a person:9 already exists.

[
	{
		id: person:9,
		name: 'Mr. 9.8'
	}
]

Interestingly, the same behaviour happens if you specify fewer fields than the existing record:

CREATE person SET id = 9.8;

But it will recognize the id as a duplicate if you change the field value or specify another field.

CREATE person SET id = 9.8, name = 'Mr. 9.8';
CREATE person SET id = 9.8, other = 'other';
CREATE person SET id = 9.8, name = 'Something else';

Expected behaviour

Probably an error that floats can't be used unless enclosed in backticks, like this: CREATE person: 9.8 ;

SurrealDB version

1.5.0 for windows on x86_64

Contact Details

Slack

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
@Dhghomon Dhghomon added bug Something isn't working triage This issue is new labels May 20, 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 triage This issue is new
Projects
None yet
Development

No branches or pull requests

1 participant
- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본