09 Sep
Posted by krisgale as best practice, mysql
sitepoint recently discovered when and why row-level locking (as opposed to table-level) is sometimes a must-have…
http://www.sitepoint.com/blogs/2009/09/08/free-performance-with-mysql-table-types/
hadn’t filled in some code i was completing and within it was a sql statement of the form:
INSERT INTO TableName () VALUES ();
to my surprise, this is valid syntax, and inserted a row with a correct auto_increment for the primary key, and null or defaults for the remaining columns.
a number of articles and blog posts exist that (attempt to) explain how one might go about connecting to a remote mysql server by way of an ssh tunnel… a vast majority of them are a copy-and-paste of the same information on how to do it using PuTTY as go-between.
seeing as how PuTTY serves the […]
no idea what version to which this applies as i’ve never installed or configured gallery2, but here’s the process by which i just now debugged one particular gallery2 install…
gallery2/config.php
line 30 - @ini_set(’display_errors’, 1);
line 134 - $gallery->setDebug(’buffered’);
1st error:
Unknown column ‘g2_Item.g_renderer’
grep -r ‘renderer’ *
modules/core/classes/GalleryStorage/schema.tpl:
CREATE TABLE DB_TABLE_PREFIXItem(
…
DB_COLUMN_PREFIXownerId int(11) NOT NULL,
DB_COLUMN_PREFIXrenderer varchar(128),
ALTER TABLE g2_Item ADD g_renderer VARCHAR(128) NULL AFTER […]
when mixing standard selects containing table aliases with LEFT JOIN’s you need be aware of a critical change as of mysql 5… if you reference a table alias in an ON clause the same way you might have in verison 4, mysql may report an ‘unknown column’ error.
so, a query of the form:
SELECT a.id FROM […]
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Nov | ||||||
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||