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
buy viagra online
buy viagra online
A Clínica Dr. Günther Heller é uma referência em tratamentos de Invisalign, ClearCorrect e implantes dentais. Sob a liderança do Dr. Heller, a clínica oferece atendimento especializado e personalizado, utilizando tecnologia avançada para criar soluções personalizadas. Os tratamentos de Invisalign e ClearCorrect são realizados por especialistas experientes, proporcionando correção discreta de problemas de alinhamento dental. Além disso, a clínica é reconhecida pela excelência em implantes dentais, oferecendo soluções duradouras e esteticamente agradáveis. Com resultados excepcionais, o Dr. Günther Heller e sua equipe garantem a satisfação dos pacientes em busca de um sorriso saudável e bonito.
payday loan
watch porn video
Online poker
лордфильм фильмы
In the vast landscape of online gaming, Jilibet has emerged as a true titan, captivating players with its exhilarating adventures and the promise of unforgettable wins. With its innovative approach, an extensive range of games, and a commitment to providing a top-tier gaming experience, Jilibet has redefined what it means to embark on a virtual gaming journey. In this article, we explore the extraordinary features that make Jilibet a standout in the industry and why it continues to be a go-to destination for gamers worldwide. A World of Endless Excitement: Jilibet offers a world of endless excitement, where every click and spin takes you on a thrilling adventure. With an extensive repertoire of games ranging from classic slots to immersive video slots and table games, Jilibet caters to all tastes and preferences. The platform partners with leading game developers to curate a diverse and ever-expanding library, ensuring that players are constantly delighted with fresh and captivating gaming experiences. Unleash the Power of Winning: At Jilibet, the pursuit of victory is celebrated and rewarded. From the moment you join, the platform greets you with enticing bonuses and promotions that boost your chances of hitting the jackpot. Jilibet's dedication to delivering exceptional wins is evident through its progressive jackpots, where life-changing sums of money are up for grabs. Whether you're a seasoned player or new to the scene, Jilibet ensures that the thrill of winning is always within reach. Cutting-Edge Technology for Immersive Gameplay: Jilibet leverages cutting-edge technology to provide an immersive and seamless gaming experience. The platform's sleek and user-friendly interface makes navigation effortless, allowing players to dive into their favorite games without any hassle. Powered by advanced software, Jilibet boasts stunning graphics, smooth animations, and immersive sound effects that transport players to a world of excitement and wonder. With compatibility across devices, Jilibet ensures that the thrill of gaming is accessible anytime, anywhere. A Safe and Secure Environment: Jilibet prioritizes the safety and security of its players. Stringent security measures, including encryption technology and firewalls, safeguard personal and financial information, providing peace of mind while gaming. The platform operates under strict regulatory frameworks, ensuring fair play and transparency. Jilibet's commitment to responsible gaming is exemplified through its comprehensive responsible gaming measures, promoting a safe and enjoyable experience for all players. Exceptional Customer Support: Jilibet understands the importance of delivering exceptional customer support. The platform's dedicated customer support team is available around the clock to assist players with any queries or concerns they may have. From technical assistance to inquiries about promotions and account management, Jilibet's support professionals are committed to providing prompt and personalized assistance, ensuring a seamless and enjoyable gaming journey for every player. Conclusion: Jilibet has solidified its position as a premier destination for online gaming, offering thrilling adventures and unforgettable wins to players worldwide. With its diverse range of games, commitment to rewarding players, cutting-edge technology, and dedication to safety and customer support, Jilibet continues to push the boundaries of what an exceptional gaming experience entails. Embark on your gaming odyssey with Jilibet and prepare to immerse yourself in a world of endless excitement, where unforgettable wins await at every turn.