I felt uncomfortable when operating mariaDB.
Isn't it an error to put a character string in a column with int specified at the table definition stage?
Also, if 11 characters or more are entered with varchar (10) etc., this will not be an error and will be truncated at 10 characters.
MariaDB [db]>create table test (id int (11) primary key); Query OK, 0 rows affected (0.04 sec) MariaDB [employee_db]>show columns from test; + ------- + --------- + ------ + ----- + --------- + ------- + | Field | Type | Null | Key | + ------- + --------- + ------ + ----- + --------- + ------- + id | int (11) | YES | | NULL | + ------- + --------- + ------ + ----- + --------- + ------- + 1 row in set (0.03 sec) MariaDB [db]>insert into test (id) values ("Ah Ah Ah Ah"); Query OK, 1 row affected, 1 warning (0.01 sec) MariaDB [db]>select * from test \ G *************************** 1. row ******************** ******* id: 0 1 row in set (0.00 sec)
Is there an error in this case?
Please give me an answer if you understand.
Answer # 1
Is there an error in this case?
MariaDB (and MySQL) has the concept of
INSERTwith an inappropriate value fails Rolled back.
SQL_MODEis set differently ... Inappropriate values may be converted by MariaDB and
INSERTas appropriate values.
Answer # 2
MariaDB and its original MySQL also have a place where the check of data entering the table is relaxed and ignored without causing an error to prevent performance degradation.
To that extent, MariaDB covers with the ability of the program writer. In severe demanding systems such as banks, Oracle is often used to check properly.
- mysql - question about how to count sql
- i have a question about git and github
- a question about unity please tell me how to display animatorsettrigger in onclick() of button
- i have a question about the array of dart (flutter)
- php - i have a question about the problem in the progate (what is variable expansion?)
- i am a beginner question about python i got an error when doing len
- about amazon linux2 mysql installation
- about the connection cancellation method between docker and mysql
- error about mysql when building environment with docker
- python - ptyhon + mysql is not reflected even if insert commit
- mysql - about production operation of application
- mysql - about switching databases
- about update of multiple records in mysql
- java - i have a question about a problem with interface
- i have a question about adding elements to a 2d array that includes a set in a list in python
- html5 - question about the behavior of normal video tags (whether it will be streamed)
- mysql - about db table naming
- about mysql user
- framework - question about displaying images saved in php/laravel s3
- php - please tell me about the availability of variables in the mysql command (update syntax)
- [mysql] about the phenomenon that the index cannot be pasted without using constraint
- mysql - how to deal with the problem that the ibdata1 file that is operating while the server is operated by sakura vps and the
- [php] how to create a link with all column information registered in the database
- mysql - i want to do a full text search
- can't pass arguments to mysqldatetime in mysql-haskell
- mysql - acquisition of data that does not exist in the table
- i don't know how to start mysql
- mysql - i don't know how to access the database
- php - assuming that "a,b" is acquired by group_concat, how do you make it an array?