Mysql
 sql >> Teknologi Basis Data >  >> RDS >> Mysql

MYSQL menonaktifkan Auto-Trim

Menurut SQL 92 dokumentasi, ketika dua string dibandingkan, mereka pertama kali dibuat sama panjangnya dengan mengisi string terpendek dengan spasi.

Telusuri 8.2 <comparison predicate> dalam dokumen.

If the length in characters of X is not equal to the length
in characters of Y, then the shorter string is effectively
replaced, for the purposes of comparison, with a copy of
itself that has been extended to the length of the longer
string by concatenation on the right of one or more pad char-
acters, where the pad character is chosen based on CS. If
CS has the NO PAD attribute, then the pad character is an
implementation-dependent character different from any char-
acter in the character set of X and Y that collates less
than any string under CS. Otherwise, the pad character is a
<space>.

Jadi dengan kata lain. Ini bukan tentang menyimpan nilai dengan jumlah spasi yang Anda masukkan, tetapi perbandingannya untuk memeriksa duplikat kunci utama. Jadi Anda tidak dapat memiliki dua string dengan jumlah spasi yang berbeda yang bertindak sebagai kunci utama




  1. Database
  2.   
  3. Mysql
  4.   
  5. Oracle
  6.   
  7. Sqlserver
  8.   
  9. PostgreSQL
  10.   
  11. Access
  12.   
  13. SQLite
  14.   
  15. MariaDB
  1. PHP/MySQL - BEGIN...COMMIT Tidak Bekerja

  2. MySQL INSERT IGNORE INTO &kunci asing

  3. Panjang indeks varchar MySQL

  4. Cara Menampilkan Susunan Tabel di MySQL

  5. database tidak dikenal di jdbc