Is there a list of all the MySQL errors that can happen on an INSERT query?
up vote
0
down vote
favorite
The error code list for MySQL is documented here https://dev.mysql.com/doc/refman/5.5/en/server-error-reference.html
But the errors are not classified and I need specifically the errors that can happen on an INSERT query.
I've found some:
1062 => insert duplicated value for unique key
1054 => unknown column
1051 => unknown table
1065 => incorrect query syntax
mysql
|
show 2 more comments
up vote
0
down vote
favorite
The error code list for MySQL is documented here https://dev.mysql.com/doc/refman/5.5/en/server-error-reference.html
But the errors are not classified and I need specifically the errors that can happen on an INSERT query.
I've found some:
1062 => insert duplicated value for unique key
1054 => unknown column
1051 => unknown table
1065 => incorrect query syntax
mysql
1
Can you tell us why? You could get disk full, wrong data types, duplicates, NOT NULL warnings, ... goodness, my head aches already
– Used_By_Already
Nov 10 at 4:02
I just need to report these errors to the end user on an app, overriding the mysql messages with more user friendly messages, by checking error codes. Besides the reason, the requirement is exactly as stated on the question, so if there are many error codes, all those should be checked. The issue is, as stated, the MySQL doc mixes many error types together, for instance connection errors and query related errors. On the other hand, I'm more concerned for app level errors like duplicates and wrong data, than infrastructure errors like disk full.
– Pablo Pazos
Nov 10 at 4:21
@MadhurBhaiya read the question, already has a link to that list, I need a specific subset as stated on the question.
– Pablo Pazos
Nov 10 at 5:20
1
Nice objective, but for debugging you will likely want access to the dbms message, and no matter how exhaustive you are with the subset, you will probably also need"Unexpected error: " & dbms-message
anyway. Good luck.
– Used_By_Already
Nov 10 at 6:05
Three of the errors you mentioned as examples should never be exposed to users of your app... because they should never occur. If they do occur, then you have design defects, bugs, and/or security vulnerabilities. It should not be possible for a user action or user input to cause an unknown table/column or empty query/syntax error, or several others. If they can, and do, then when you reveal the error to the user, you are also providing malicious actors with information they may find useful in exploiting your vulnerabilities. Reconsider your strategy.
– Michael - sqlbot
Nov 10 at 16:57
|
show 2 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
The error code list for MySQL is documented here https://dev.mysql.com/doc/refman/5.5/en/server-error-reference.html
But the errors are not classified and I need specifically the errors that can happen on an INSERT query.
I've found some:
1062 => insert duplicated value for unique key
1054 => unknown column
1051 => unknown table
1065 => incorrect query syntax
mysql
The error code list for MySQL is documented here https://dev.mysql.com/doc/refman/5.5/en/server-error-reference.html
But the errors are not classified and I need specifically the errors that can happen on an INSERT query.
I've found some:
1062 => insert duplicated value for unique key
1054 => unknown column
1051 => unknown table
1065 => incorrect query syntax
mysql
mysql
asked Nov 10 at 3:54
Pablo Pazos
1,4271125
1,4271125
1
Can you tell us why? You could get disk full, wrong data types, duplicates, NOT NULL warnings, ... goodness, my head aches already
– Used_By_Already
Nov 10 at 4:02
I just need to report these errors to the end user on an app, overriding the mysql messages with more user friendly messages, by checking error codes. Besides the reason, the requirement is exactly as stated on the question, so if there are many error codes, all those should be checked. The issue is, as stated, the MySQL doc mixes many error types together, for instance connection errors and query related errors. On the other hand, I'm more concerned for app level errors like duplicates and wrong data, than infrastructure errors like disk full.
– Pablo Pazos
Nov 10 at 4:21
@MadhurBhaiya read the question, already has a link to that list, I need a specific subset as stated on the question.
– Pablo Pazos
Nov 10 at 5:20
1
Nice objective, but for debugging you will likely want access to the dbms message, and no matter how exhaustive you are with the subset, you will probably also need"Unexpected error: " & dbms-message
anyway. Good luck.
– Used_By_Already
Nov 10 at 6:05
Three of the errors you mentioned as examples should never be exposed to users of your app... because they should never occur. If they do occur, then you have design defects, bugs, and/or security vulnerabilities. It should not be possible for a user action or user input to cause an unknown table/column or empty query/syntax error, or several others. If they can, and do, then when you reveal the error to the user, you are also providing malicious actors with information they may find useful in exploiting your vulnerabilities. Reconsider your strategy.
– Michael - sqlbot
Nov 10 at 16:57
|
show 2 more comments
1
Can you tell us why? You could get disk full, wrong data types, duplicates, NOT NULL warnings, ... goodness, my head aches already
– Used_By_Already
Nov 10 at 4:02
I just need to report these errors to the end user on an app, overriding the mysql messages with more user friendly messages, by checking error codes. Besides the reason, the requirement is exactly as stated on the question, so if there are many error codes, all those should be checked. The issue is, as stated, the MySQL doc mixes many error types together, for instance connection errors and query related errors. On the other hand, I'm more concerned for app level errors like duplicates and wrong data, than infrastructure errors like disk full.
– Pablo Pazos
Nov 10 at 4:21
@MadhurBhaiya read the question, already has a link to that list, I need a specific subset as stated on the question.
– Pablo Pazos
Nov 10 at 5:20
1
Nice objective, but for debugging you will likely want access to the dbms message, and no matter how exhaustive you are with the subset, you will probably also need"Unexpected error: " & dbms-message
anyway. Good luck.
– Used_By_Already
Nov 10 at 6:05
Three of the errors you mentioned as examples should never be exposed to users of your app... because they should never occur. If they do occur, then you have design defects, bugs, and/or security vulnerabilities. It should not be possible for a user action or user input to cause an unknown table/column or empty query/syntax error, or several others. If they can, and do, then when you reveal the error to the user, you are also providing malicious actors with information they may find useful in exploiting your vulnerabilities. Reconsider your strategy.
– Michael - sqlbot
Nov 10 at 16:57
1
1
Can you tell us why? You could get disk full, wrong data types, duplicates, NOT NULL warnings, ... goodness, my head aches already
– Used_By_Already
Nov 10 at 4:02
Can you tell us why? You could get disk full, wrong data types, duplicates, NOT NULL warnings, ... goodness, my head aches already
– Used_By_Already
Nov 10 at 4:02
I just need to report these errors to the end user on an app, overriding the mysql messages with more user friendly messages, by checking error codes. Besides the reason, the requirement is exactly as stated on the question, so if there are many error codes, all those should be checked. The issue is, as stated, the MySQL doc mixes many error types together, for instance connection errors and query related errors. On the other hand, I'm more concerned for app level errors like duplicates and wrong data, than infrastructure errors like disk full.
– Pablo Pazos
Nov 10 at 4:21
I just need to report these errors to the end user on an app, overriding the mysql messages with more user friendly messages, by checking error codes. Besides the reason, the requirement is exactly as stated on the question, so if there are many error codes, all those should be checked. The issue is, as stated, the MySQL doc mixes many error types together, for instance connection errors and query related errors. On the other hand, I'm more concerned for app level errors like duplicates and wrong data, than infrastructure errors like disk full.
– Pablo Pazos
Nov 10 at 4:21
@MadhurBhaiya read the question, already has a link to that list, I need a specific subset as stated on the question.
– Pablo Pazos
Nov 10 at 5:20
@MadhurBhaiya read the question, already has a link to that list, I need a specific subset as stated on the question.
– Pablo Pazos
Nov 10 at 5:20
1
1
Nice objective, but for debugging you will likely want access to the dbms message, and no matter how exhaustive you are with the subset, you will probably also need
"Unexpected error: " & dbms-message
anyway. Good luck.– Used_By_Already
Nov 10 at 6:05
Nice objective, but for debugging you will likely want access to the dbms message, and no matter how exhaustive you are with the subset, you will probably also need
"Unexpected error: " & dbms-message
anyway. Good luck.– Used_By_Already
Nov 10 at 6:05
Three of the errors you mentioned as examples should never be exposed to users of your app... because they should never occur. If they do occur, then you have design defects, bugs, and/or security vulnerabilities. It should not be possible for a user action or user input to cause an unknown table/column or empty query/syntax error, or several others. If they can, and do, then when you reveal the error to the user, you are also providing malicious actors with information they may find useful in exploiting your vulnerabilities. Reconsider your strategy.
– Michael - sqlbot
Nov 10 at 16:57
Three of the errors you mentioned as examples should never be exposed to users of your app... because they should never occur. If they do occur, then you have design defects, bugs, and/or security vulnerabilities. It should not be possible for a user action or user input to cause an unknown table/column or empty query/syntax error, or several others. If they can, and do, then when you reveal the error to the user, you are also providing malicious actors with information they may find useful in exploiting your vulnerabilities. Reconsider your strategy.
– Michael - sqlbot
Nov 10 at 16:57
|
show 2 more comments
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53235867%2fis-there-a-list-of-all-the-mysql-errors-that-can-happen-on-an-insert-query%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Can you tell us why? You could get disk full, wrong data types, duplicates, NOT NULL warnings, ... goodness, my head aches already
– Used_By_Already
Nov 10 at 4:02
I just need to report these errors to the end user on an app, overriding the mysql messages with more user friendly messages, by checking error codes. Besides the reason, the requirement is exactly as stated on the question, so if there are many error codes, all those should be checked. The issue is, as stated, the MySQL doc mixes many error types together, for instance connection errors and query related errors. On the other hand, I'm more concerned for app level errors like duplicates and wrong data, than infrastructure errors like disk full.
– Pablo Pazos
Nov 10 at 4:21
@MadhurBhaiya read the question, already has a link to that list, I need a specific subset as stated on the question.
– Pablo Pazos
Nov 10 at 5:20
1
Nice objective, but for debugging you will likely want access to the dbms message, and no matter how exhaustive you are with the subset, you will probably also need
"Unexpected error: " & dbms-message
anyway. Good luck.– Used_By_Already
Nov 10 at 6:05
Three of the errors you mentioned as examples should never be exposed to users of your app... because they should never occur. If they do occur, then you have design defects, bugs, and/or security vulnerabilities. It should not be possible for a user action or user input to cause an unknown table/column or empty query/syntax error, or several others. If they can, and do, then when you reveal the error to the user, you are also providing malicious actors with information they may find useful in exploiting your vulnerabilities. Reconsider your strategy.
– Michael - sqlbot
Nov 10 at 16:57