Why does TINYINT(1) function as a boolean but INT(1) does not?

后端 未结 5 1229
无人共我
无人共我 2020-12-08 22:21

Why does TINYINT(1) work as a boolean? The way I understood the official docs, the (1) should mean it has a display width of 1, so if I store 56 in

5条回答
  •  眼角桃花
    2020-12-08 23:22

    As I understand it, TINYINT(1) can only hold '0' or '1' (from own experience).
    Thus, one can assume that the '0' or '1' is translated into true or false.

提交回复
热议问题