FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Change ID validation for insert operation to detect non-int values by Owly-dabs · Pull Request #115 · cstack/db_tutorial · GitHub

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

Open
Owly-dabs wants to merge 1 commit into
cstack: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 into
cstack:masterfrom
Owly-dabs:patch-1

Conversation

Copy link
Copy Markdown

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`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL