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










share|improve this question


















  • 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

















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










share|improve this question


















  • 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















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










share|improve this question













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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 3:54









Pablo Pazos

1,4361125




1,4361125








  • 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




    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



















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















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






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Schultheiß

Verwaltungsgliederung Dänemarks

Liste der Kulturdenkmale in Wilsdruff