This section describes changes made in each version of the Sakila sample database.
Fixed MySQL Bug #112131: Made the film_text.film_id field unsigned to match the other film_id definitions.
Films without an actor were not returned by the film_list and nicer_but_slower_film_list views.
Fixed MySQL Bug #106951: Accented characters were missing from the
city
andcountry
fields; their values were updated using theworld
database. In addition, the acute accent character itself was also missing.Fixed MySQL Bug #107158: Removed five rows in the payment table that had a null rental_id value.
Database objects now use
utf8mb4
rather thanutf8
. This change caused aSpecified key was too long; max key length is 767 bytes
error in MySQL 5.6 for thefilm.title
column, which was declared asVARCHAR(255)
. The actual maximum title length is 27 characters, so the column was redeclared asVARCHAR(128)
to avoid exceeding the maximum key length.sakila-schema.sql
andsakila-data.sql
include aSET NAMES utf8mb4
statement.sakila-data.sql
was converted from DOS (CRLF) line endings to Unix (LF) line endings.The
address.location
column is aGEOMETRY
column that has aSPATIAL
index. As of MySQL 8.0.3,SPATIAL
indexes are ignored unless the index spatial column has anSRID
attribute. Thelocation
column was changed to include anSRID 0
attribute for MySQL 8.0.3 and higher.The
staff.password
column was declared asVARCHAR(40) BINARY
. This is use ofBINARY
as shorthand in a character column declaration for specifying a_bin
collation, which is deprecated as of MySQL 8.0.17. The column was redeclared as whatBINARY
is shorthand for, that is,VARCHAR(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin
.In the
rewards_report()
stored procedure, themin_dollar_amount_purchased
parameter was declared asDECIMAL(10,2) UNSIGNED
. Use ofUNSIGNED
withDECIMAL
is deprecated as of MySQL 8.0.17. The parameter was redeclared withoutUNSIGNED
.The
film_in_stock()
andfilm_not_in_stock()
stored procedures used theFOUND_ROWS()
function, which is deprecated as of MySQL 8.0.17. In each procedure, theFOUND_ROWS()
query was replaced by a query that usesCOUNT(*)
with the sameFROM
andWHERE
clauses as its associated query. This is more expensive than usingFOUND_ROWS()
but produces the same result.The
film_text
table usesMyISAM
rather thanInnoDB
prior to MySQL 5.6.10 to avoid table-creation failure in older versions. (However, we still recommend upgrading to MySQL 5.6.10 or higher.)The
sakila.mwb
file for MySQL Workbench was updated per the preceding changes.
Removed all
MyISAM
references. Thefilm_text
table, and itsFULLTEXT
definition, now usesInnoDB
. If you use an older MySQL server version (5.6.10 and lower), we recommend upgrading MySQL. If you cannot upgrade, change theENGINE
value for thefilm_text
table toMyISAM
in thesakila-schema.sql
SQL file.
-
Merged
sakila-schema.sql
andsakila-spatial-schema.sql
into a single file by using MySQL version-specific comments.Spatial data, such as
address.location
, is inserted into the sakila database as of MySQL server 5.7.5 (when spatial indexing support was added toInnoDB
). Also,InnoDB
full-text search is used as of MySQL server 5.6.10, when beforeMyISAM
was used.
Added an additional copy of the Sakila example database that includes spatial data with the geometry data type. This is available as a separate download, and requires MySQL server 5.7.5 or later. To use this database, load the
sakila-spatial-schema.sql
file rather than thesakila-schema.sql
file.Modified
GROUP BY
clause of thenicer_but_slower_film_list
andfilm_list
view definitions to be compatible withONLY_FULL_GROUP_BY
SQL mode, which is enabled by default as of MySQL 5.7.5.
Corrected
upd_film
trigger definition to include changes tofilm_id
values.Added
actor_info
view.Changed error handler for
inventory_held_by_customer
function. Function now has an exit handler forNOT FOUND
instead of the more cryptic1329
.Added template for new BSD license to schema and data files.
Added
READS SQL DATA
to the stored procedures and functions where appropriate to support loading on MySQL 5.1.Fixed date-range issue in the
rewards_report
procedure (thanks Goplat).
Fixed bug in
sales_by_store
view that caused the same manager to be listed for every store.Fixed bug in
inventory_held_by_customer
function that caused function to return multiple rows.Moved
rental_date
trigger tosakila-data.sql
file to prevent it from interfering with data loading.
Added
film_in_stock
stored procedure.Added
film_not_in_stock
stored procedure.Added
inventory_help_by_customer
stored function.Added
inventory__in_stock
stored function.Optimized data file for loading (multiple-row
INSERT
statements, transactions). (Thanks Giuseppe)Fixed error in
payment
table loading script that caused infinitely increasing payment amounts.
Added
sales_by_store
andsales_by_film_category
views, submitted by Jay Pipes.Added
rewards_report
stored procedure, submitted by Jay Pipes.Added
get_customer_balance
stored procedure.Added
sakila-data.sql
file to load data into sample database.
Changed
address.district
toVARCHAR(20)
.Changed
customer.first_name
toVARCHAR(45)
.Changed
customer.last_name
toVARCHAR(45)
.Changed
customer.email
toVARCHAR(50)
.Added
payment.rental_id
column (anINT NULL
column).Foreign key added for
payment.rental_id
torental.rental_id
.rental.rental_id
added,INT Auto_Increment
, made into surrogate primary key, old primary key changed toUNIQUE
key.
All tables have a
last_update
TIMESTAMP
column with traditional behavior (DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
).actor_id
is now aSMALLINT
.address_id
is now aSMALLINT
.category_id
is now aTINYINT
.city_id
is now aSMALLINT
.country_id
is now aSMALLINT
.customer_id
is now aSMALLINT
.first_name
,last_name
forcustomer
table are nowCHAR
instead ofVARCHAR
.customer
table now hasemail CHAR(50)
.create_date
oncustomer
table is nowDATETIME
(to accommodatelast_update TIMESTAMP
).customer
table has a newON INSERT
trigger that enforcescreate_date
column being set toNOW()
.film_id
is nowSMALLINT
.film.description
now hasDEFAULT NULL
.film.release_year
added with typeYEAR
.film.language_id
andfilm.original_language_id
added along withlanguage
table. For foreign films that may have been subtitled.original_language_id
can beNULL
,language_id
isNOT NULL
.film.length
is nowSMALLINT
.film.category_id
column removed.New table:
film_category
; allows for multiple categories per film.film_text.category_id
column removed.inventory_id
is nowMEDIUMINT
.payment_id
is nowSMALLINT
.payment.payment_date
is nowDATETIME
.Trigger added to
payment
table to enforce thatpayment_date
is set toNOW()
uponINSERT
.rental.rent_date
is nowrental.rental_date
and is nowDATETIME
.Trigger added to
rental
table to enforce thatrental_date
is set toNOW()
uponINSERT
.staff_id
is nowTINYINT
.staff.email
added (VARCHAR(50)
).staff.username
added (VARCHAR(16)
).store_id
is nowTINYINT
.film_list
view updated to handle newfilm_category
table.nicer_but_slower_film_list
view updated to handle newfilm_category
table.