1#
2# VARCHAR column types
3#
4
5--disable_warnings
6DROP TABLE IF EXISTS t1, t2;
7--enable_warnings
8
9eval CREATE TABLE t1 (
10  v0 VARCHAR(0) $extra_col_opts,
11  v1 VARCHAR(1) $extra_col_opts,
12  v64 VARCHAR(64) $extra_col_opts,
13  v65000 VARCHAR(65000) $extra_col_opts,
14  PRIMARY KEY (v64)
15) ENGINE=rocksdb;
16
17SHOW COLUMNS IN t1;
18
19CREATE TABLE t2 (v VARCHAR(65532), PRIMARY KEY (v(255))) ENGINE=rocksdb;
20SHOW COLUMNS IN t2;
21
22# Valid values
23
24INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','','','');
25INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('','y','Once there, double check that an article doesn\'t already exist','Here is a list of recommended books on MariaDB and MySQL. We\'ve provided links to Amazon.com here for convenience, but they can be found at many other bookstores, both online and off.
26
27  If you want to have your favorite MySQL / MariaDB book listed here, please leave a comment.
28  For developers who want to code on MariaDB or MySQL
29
30      * Understanding MySQL Internals by Sasha Pachev, former MySQL developer at MySQL AB.
31            o This is the only book we know about that describes the internals of MariaDB / MySQL. A must have for anyone who wants to understand and develop on MariaDB!
32            o Not all topics are covered and some parts are slightly outdated, but still the best book on this topic.
33      * MySQL 5.1 Plugin Development by Sergei Golubchik and Andrew Hutchings
34            o A must read for anyone wanting to write a plugin for MariaDB, written by the Sergei who designed the plugin interface for MySQL and MariaDB!
35
36  For MariaDB / MySQL end users
37
38      * MariaDB Crash Course by Ben Forta
39            o First MariaDB book!
40            o For people who want to learn SQL and the basics of MariaDB.
41            o Now shipping. Purchase at Amazon.com or your favorite bookseller.
42
43      * SQL-99 Complete, Really by Peter Gulutzan & Trudy Pelzer.
44            o Everything you wanted to know about the SQL 99 standard. Excellent reference book!
45            o Free to read in the Knowledgebase!
46
47      * MySQL (4th Edition) by Paul DuBois
48            o The \'default\' book to read if you wont to learn to use MySQL / MariaDB.
49
50      * MySQL Cookbook by Paul DuBois
51            o A lot of examples of how to use MySQL. As with all of Paul\'s books, it\'s worth its weight in gold and even enjoyable reading for such a \'dry\' subject.
52
53      * High Performance MySQL, Second Edition, By Baron Schwartz, Peter Zaitsev, Vadim Tkachenko, Jeremy D. Zawodny, Arjen Lentz, Derek J. Balling, et al.
54            o \"High Performance MySQL is the definitive guide to building fast, reliable systems with MySQL. Written by noted experts with years of real-world experience building very large systems, this book covers every aspect of MySQL performance in detail, and focuses on robustness, security, and data integrity. Learn advanced techniques in depth so you can bring out MySQL\'s full power.\" (From the book description at O\'Reilly)
55
56      * MySQL Admin Cookbook
57            o A quick step-by-step guide for MySQL users and database administrators to tackle real-world challenges with MySQL configuration and administration
58
59      * MySQL 5.0 Certification Study Guide, By Paul DuBois, Stefan Hinz, Carsten Pedersen
60            o This is the official guide to cover the passing of the two MySQL Certification examinations. It is valid till version 5.0 of the server, so while it misses all the features available in MySQL 5.1 and greater (including MariaDB 5.1 and greater), it provides a good basic understanding of MySQL for the end-user. ');
61
62--sorted_result
63SELECT v0,v1,v64,v65000 FROM t1;
64
65# Invalid values
66
67INSERT INTO t1 (v0,v1,v64,v65000) VALUES ('y', 'yy', REPEAT('c',65), REPEAT('abcdefghi ',6501));
68INSERT INTO t1 (v0,v1,v64,v65000) SELECT v65000, v65000, CONCAT('a',v65000), CONCAT(v65000,v1) FROM t1;
69
70--sorted_result
71SELECT v0, v1, v64, LENGTH(v65000) FROM t1;
72
73eval ALTER TABLE t1 ADD COLUMN v65536 VARCHAR(65536) $extra_col_opts;
74SHOW COLUMNS IN t1;
75
76DROP TABLE t1, t2;
77
78