Skip to content

Change ID validation for insert operation to detect non-int values#115

Open
Owly-dabs wants to merge 1 commit intocstack:masterfrom
Owly-dabs:patch-1
Open

Change ID validation for insert operation to detect non-int values#115
Owly-dabs wants to merge 1 commit intocstack:masterfrom
Owly-dabs:patch-1

Conversation

@Owly-dabs
Copy link

User should not be able to execute an operation as such:

db > insert somestring myuser myemail

Right now, the user may execute the above command and get the following when using db > select:

(0, myuser, myemail)

atoi returns 0 for invalid input. Thus, the invalid PrepareResult status PREPARE_NEGATIVE_ID should be returned if int id = 0.

User should not be able to execute an operation as such:
```
db > insert somestring myuser myemail
```
Right now, the user may execute the above command and get the following when using `db > select`:
```
(0, myuser, myemail)
```

`atoi` returns 0 for invalid input. Thus, the invalid `PrepareResult` status `PREPARE_NEGATIVE_ID` should be returned if `int id = 0`.
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.

1 participant