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
cityandcountryfields; their values were updated using theworlddatabase. 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
utf8mb4rather thanutf8. This change caused aSpecified key was too long; max key length is 767 byteserror in MySQL 5.6 for thefilm.titlecolumn, 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.sqlandsakila-data.sqlinclude aSET NAMES utf8mb4statement.sakila-data.sqlwas converted from DOS (CRLF) line endings to Unix (LF) line endings.The
address.locationcolumn is aGEOMETRYcolumn that has aSPATIALindex. As of MySQL 8.0.3,SPATIALindexes are ignored unless the index spatial column has anSRIDattribute. Thelocationcolumn was changed to include anSRID 0attribute for MySQL 8.0.3 and higher.The
staff.passwordcolumn was declared asVARCHAR(40) BINARY. This is use ofBINARYas shorthand in a character column declaration for specifying a_bincollation, which is deprecated as of MySQL 8.0.17. The column was redeclared as whatBINARYis shorthand for, that is,VARCHAR(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin.In the
rewards_report()stored procedure, themin_dollar_amount_purchasedparameter was declared asDECIMAL(10,2) UNSIGNED. Use ofUNSIGNEDwithDECIMALis 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 sameFROMandWHEREclauses as its associated query. This is more expensive than usingFOUND_ROWS()but produces the same result.The
film_texttable usesMyISAMrather thanInnoDBprior 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.mwbfile for MySQL Workbench was updated per the preceding changes.
Removed all
MyISAMreferences. Thefilm_texttable, and itsFULLTEXTdefinition, now usesInnoDB. If you use an older MySQL server version (5.6.10 and lower), we recommend upgrading MySQL. If you cannot upgrade, change theENGINEvalue for thefilm_texttable toMyISAMin thesakila-schema.sqlSQL file.
-
Merged
sakila-schema.sqlandsakila-spatial-schema.sqlinto 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,InnoDBfull-text search is used as of MySQL server 5.6.10, when beforeMyISAMwas 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.sqlfile rather than thesakila-schema.sqlfile.Modified
GROUP BYclause of thenicer_but_slower_film_listandfilm_listview definitions to be compatible withONLY_FULL_GROUP_BYSQL mode, which is enabled by default as of MySQL 5.7.5.
Corrected
upd_filmtrigger definition to include changes tofilm_idvalues.Added
actor_infoview.Changed error handler for
inventory_held_by_customerfunction. Function now has an exit handler forNOT FOUNDinstead of the more cryptic1329.Added template for new BSD license to schema and data files.
Added
READS SQL DATAto the stored procedures and functions where appropriate to support loading on MySQL 5.1.Fixed date-range issue in the
rewards_reportprocedure (thanks Goplat).
Fixed bug in
sales_by_storeview that caused the same manager to be listed for every store.Fixed bug in
inventory_held_by_customerfunction that caused function to return multiple rows.Moved
rental_datetrigger tosakila-data.sqlfile to prevent it from interfering with data loading.
Added
film_in_stockstored procedure.Added
film_not_in_stockstored procedure.Added
inventory_help_by_customerstored function.Added
inventory__in_stockstored function.Optimized data file for loading (multiple-row
INSERTstatements, transactions). (Thanks Giuseppe)Fixed error in
paymenttable loading script that caused infinitely increasing payment amounts.
Added
sales_by_storeandsales_by_film_categoryviews, submitted by Jay Pipes.Added
rewards_reportstored procedure, submitted by Jay Pipes.Added
get_customer_balancestored procedure.Added
sakila-data.sqlfile to load data into sample database.
Changed
address.districttoVARCHAR(20).Changed
customer.first_nametoVARCHAR(45).Changed
customer.last_nametoVARCHAR(45).Changed
customer.emailtoVARCHAR(50).Added
payment.rental_idcolumn (anINT NULLcolumn).Foreign key added for
payment.rental_idtorental.rental_id.rental.rental_idadded,INT Auto_Increment, made into surrogate primary key, old primary key changed toUNIQUEkey.
All tables have a
last_updateTIMESTAMPcolumn with traditional behavior (DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP).actor_idis now aSMALLINT.address_idis now aSMALLINT.category_idis now aTINYINT.city_idis now aSMALLINT.country_idis now aSMALLINT.customer_idis now aSMALLINT.first_name,last_nameforcustomertable are nowCHARinstead ofVARCHAR.customertable now hasemail CHAR(50).create_dateoncustomertable is nowDATETIME(to accommodatelast_update TIMESTAMP).customertable has a newON INSERTtrigger that enforcescreate_datecolumn being set toNOW().film_idis nowSMALLINT.film.descriptionnow hasDEFAULT NULL.film.release_yearadded with typeYEAR.film.language_idandfilm.original_language_idadded along withlanguagetable. For foreign films that may have been subtitled.original_language_idcan beNULL,language_idisNOT NULL.film.lengthis nowSMALLINT.film.category_idcolumn removed.New table:
film_category; allows for multiple categories per film.film_text.category_idcolumn removed.inventory_idis nowMEDIUMINT.payment_idis nowSMALLINT.payment.payment_dateis nowDATETIME.Trigger added to
paymenttable to enforce thatpayment_dateis set toNOW()uponINSERT.rental.rent_dateis nowrental.rental_dateand is nowDATETIME.Trigger added to
rentaltable to enforce thatrental_dateis set toNOW()uponINSERT.staff_idis nowTINYINT.staff.emailadded (VARCHAR(50)).staff.usernameadded (VARCHAR(16)).store_idis nowTINYINT.film_listview updated to handle newfilm_categorytable.nicer_but_slower_film_listview updated to handle newfilm_categorytable.