mysql中TIMESTAMP类型和其他的类型有点不一样(在没有设置explicit_defaults_for_timestamp=1的情况下)
1、在默认情况下,如果TIMESTAMP列没有显式的指明null属性,那么该列会被自动加上not null属性(而其他类型的列如果没有被显式的指定not null,那么是允许null值的),如果往这个列中插入null值,会自动的设置该列的值为current timestamp值
2、表中的第一个TIMESTAMP列,如果没有指定null属性或者没有指定默认值,也没有指定ON UPDATE语句。那么该列会自动被加上DEFAULT CURRENT_TIMESTAMP和ON UPDATE CURRENT_TIMESTAMP属性。
3、第一个TIMESTAMP列之后的其他的TIMESTAMP类型的列,如果没有指定null属性,也没有指定默认值,那么该列会被自动加上DEFAULT '0000-00-00 00:00:00'属性。如果insert语句中没有为该列指定值,那么该列中插入'0000-00-00 00:00:00',并且没有warning
如果我们在启动的时候在配置文件中指定了explicit_defaults_for_timestamp=1,mysql会按照如下的方式处理TIMESTAMP 列
1、此时如果TIMESTAMP列没有显式的指定not null属性,那么默认的该列可以为null,此时向该列中插入null值时,会直接记录null,而不是current timestamp。
2、不会自动的为表中的第一个TIMESTAMP列加上DEFAULT CURRENT_TIMESTAMP 和ON UPDATE CURRENT_TIMESTAMP属性,除非你在建表的时候显式的指明
3、如果TIMESTAMP列被加上了not null属性,并且没有指定默认值。这时如果向表中插入记录,但是没有给该TIMESTAMP列指定值的时候,如果strict sql_mode被指定了,那么会直接报错。如果strict sql_mode没有被指定,那么会向该列中插入'0000-00-00 00:00:00'并且产生一个warning
文章最后更新时间:
2019年01月17日 21:26:51
kino hd
If yoou have played the other videoo slots from JFTW you will be looking for soime new special feature. We are sending quick questions, links to websites, and attach documents, pictures, music and video files. As newer and more memory-intensive software comes out, and old junk files accumulate on your hard drive, your computer gets slower and slower, and woorking with it gets more and more frustrating. When three or more appear anywhere on the reels they trigger the free spins feature. Eviscerate on further to see by what different technjiques you could research free slot games. In all honesty, you might be frustrated to like that people consistently go in for the choice to see slopt games in the betting clubs. Therefore, it really is reliable advice that it is a choice that you would likje to take full advantage of byy far when compared to other choices that are available. Online casino with welcome bonus - RAJAWIN
kino hd
Что делать, если украли гос номера с авто? изготовление номеров на автомобиль - утром обратился, через 2 часа привез курьер домой.
buy viagra online
payday loan
кино онлайн
A Clínica Dr. Günther Heller é uma referência em tratamentos de Invisalign, ClearCorrect e implantes dentais. Liderada pelo renomado Dr. Heller, a clínica oferece atendimento especializado e personalizado, utilizando tecnologia avançada para criar soluções personalizadas. Com expertise em ortodontia, os tratamentos de Invisalign e ClearCorrect são discretos e eficazes para corrigir problemas de alinhamento dental. Além disso, a clínica é reconhecida pela excelência em implantes dentais, oferecendo resultados duradouros e esteticamente agradáveis. Com uma equipe qualificada e liderança experiente, a Clínica Dr. Günther Heller é a escolha certa para transformar sorrisos e obter uma saúde bucal de qualidade.
payday loan