tag:blogger.com,1999:blog-11965249.post8040933469265533830..comments2024-01-15T11:31:46.282+01:00Comments on Rudy's DBland: MySQL 5 secondo Alex PapadimoulisRudyhttp://www.blogger.com/profile/05494812158299383717noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-11965249.post-50211690774055243262007-08-25T14:47:00.000+02:002007-08-25T14:47:00.000+02:00Si ma bisogna smitizzare le concezioni errate che ...Si ma bisogna smitizzare le concezioni errate che la gente ha: non sono bug ma feature.<BR/><BR/>Da: <BR/>http://dev.mysql.com/doc/refman/5.0/en/constraint-invalid-data.html<BR/><BR/>"If you are not using strict mode, then whenever you insert an “incorrect” value into a column, such as a NULL into a NOT NULL column or a too-large numeric value into a numeric column, MySQL sets the column to the “best possible value” instead of producing an error"<BR/><BR/>Il server sceglierà per voi il miglior valore possibile! Non vi sentite già sollevati dal dover prendere gravose decisioni?<BR/><BR/>Inoltre il comportamento cambia a seconda del numero di righe da inserire:<BR/><BR/>"If you try to store NULL into a column that doesn't take NULL values, an error occurs for single-row INSERT statements. For multiple-row INSERT statements or for INSERT INTO ... SELECT statements, MySQL Server stores the implicit default value for the column data type"<BR/><BR/>Se fate i bravini ed inserite una riga alla volta allora vi restituirà l'eventuale errore; alrimenti "best value" a valanga.Anonymousnoreply@blogger.com