Guest User

Untitled

a guest
Jul 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. mysql> create table foo (id int(10) primary key auto_increment);
  2. Query OK, 0 rows affected (0.22 sec)
  3.  
  4. mysql> alter table foo add column bar varchar(12);
  5. Query OK, 0 rows affected (0.37 sec)
  6. Records: 0 Duplicates: 0 Warnings: 0
  7.  
  8. mysql> insert into foo set bar="BLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAHBLAH";
  9. Query OK, 1 row affected, 1 warning (0.00 sec)
  10.  
  11. mysql> select * from foo;
  12. +----+--------------+
  13. | id | bar |
  14. +----+--------------+
  15. | 1 | BLAHBLAHBLAH |
  16. +----+--------------+
  17. 1 row in set (0.00 sec)
  18.  
  19. mysql> alter table foo modify bar varchar(256);
  20. Query OK, 1 row affected (0.05 sec)
  21. Records: 1 Duplicates: 0 Warnings: 0
  22.  
  23. mysql> select * from foo;
  24. +----+--------------+
  25. | id | bar |
  26. +----+--------------+
  27. | 1 | BLAHBLAHBLAH |
  28. +----+--------------+
  29. 1 row in set (0.00 sec)
  30.  
  31. mysql>
Add Comment
Please, Sign In to add comment