[GRASS-SVN] r59060 - in grass/branches/releasebranch_6_4: db/drivers/mysql lib/db/sqlp

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Feb 15 14:27:06 PST 2014


Author: neteler
Date: 2014-02-15 14:27:05 -0800 (Sat, 15 Feb 2014)
New Revision: 59060

Modified:
   grass/branches/releasebranch_6_4/db/drivers/mysql/grass-mesql.html
   grass/branches/releasebranch_6_4/db/drivers/mysql/grass-mysql.html
   grass/branches/releasebranch_6_4/lib/db/sqlp/description.html
Log:
sql.html, MySQL manual: explain syntax error in case of using a reserved SQL word (help for trac #2184)

Modified: grass/branches/releasebranch_6_4/db/drivers/mysql/grass-mesql.html
===================================================================
--- grass/branches/releasebranch_6_4/db/drivers/mysql/grass-mesql.html	2014-02-15 22:26:46 UTC (rev 59059)
+++ grass/branches/releasebranch_6_4/db/drivers/mysql/grass-mesql.html	2014-02-15 22:27:05 UTC (rev 59060)
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
-<title>GRASS-MySQL embedded driver</title>
+<title>GRASS GIS manual: GRASS-MySQL embedded driver</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <link rel="stylesheet" href="grassdocs.css" type="text/css">
 </head>
@@ -12,6 +12,11 @@
 <!-- meta page description: MySQL embedded driver -->
 <h1>MySQL embedded driver in GRASS</h1>
 
+<h2>KEYWORDS</h2>
+database, attribute table, driver
+
+<h2>DESCRIPTION</h2>
+
 MySQL database driver in GRASS enables GRASS to store vector
 attributes in MySQL embedded database without necessity 
 to run MySQL server.
@@ -52,6 +57,12 @@
 option to avoid warning about missing 
 "mysql.time_zone_leap_second table". This can be fixed in future.
 
+<h2>Troubleshooting: SQL syntax error</h2>
+
+Attempting to use a reserved SQL word as column or table name will result
+in a "SQL syntax" error. The list of reserved words for MySQL can be
+found in the <a href="http://dev.mysql.com/doc/refman/5.7/en/reserved-words.html#table-reserved-words-5.7.4">MySQL manual</a>.
+
 <h2>SEE ALSO</h2>
 
 <em>

Modified: grass/branches/releasebranch_6_4/db/drivers/mysql/grass-mysql.html
===================================================================
--- grass/branches/releasebranch_6_4/db/drivers/mysql/grass-mysql.html	2014-02-15 22:26:46 UTC (rev 59059)
+++ grass/branches/releasebranch_6_4/db/drivers/mysql/grass-mysql.html	2014-02-15 22:27:05 UTC (rev 59060)
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 <html>
 <head>
-<title>GRASS-MySQL driver</title>
+<title>GRASS GIS manual: GRASS-MySQL driver</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <link rel="stylesheet" href="grassdocs.css" type="text/css">
 </head>
@@ -12,6 +12,11 @@
 <!-- meta page description: MySQL driver -->
 <h1>MySQL driver in GRASS</h1>
 
+<h2>KEYWORDS</h2>
+database, attribute table, driver
+
+<h2>DESCRIPTION</h2>
+
 MySQL database driver in GRASS enables GRASS to store vector
 attributes in MySQL server.
 <p>
@@ -105,6 +110,12 @@
 by 'group' parameter of module db.connect are ignored by
 GRASS for MySQL driver.
 
+<h2>Troubleshooting: SQL syntax error</h2>
+
+Attempting to use a reserved SQL word as column or table name will result
+in a "SQL syntax" error. The list of reserved words for MySQL can be
+found in the <a href="http://dev.mysql.com/doc/refman/5.7/en/reserved-words.html#table-reserved-words-5.7.4">MySQL manual</a>.
+
 <h2>SEE ALSO</h2>
 
 <em>

Modified: grass/branches/releasebranch_6_4/lib/db/sqlp/description.html
===================================================================
--- grass/branches/releasebranch_6_4/lib/db/sqlp/description.html	2014-02-15 22:26:46 UTC (rev 59059)
+++ grass/branches/releasebranch_6_4/lib/db/sqlp/description.html	2014-02-15 22:27:05 UTC (rev 59060)
@@ -15,13 +15,15 @@
 <!-- meta page description: SQL support introduction -->
 <h2>SQL support in GRASS GIS</h2>
 
-GRASS can use various RDBMS and embedded databases. 
-SQL queries are directly passed to the underlying 
-database system. 
-The set of supported SQL commands depends on the RDMBS 
-and driver selected.  
+GRASS can use various RDBMS
+(<a href="http://en.wikipedia.org/wiki/Relational_database_management_system">Relational
+database management system</a>) and embedded databases. SQL
+(<a href="http://en.wikipedia.org/wiki/Sql">Structured Query
+Language</a>) queries are directly passed to the underlying database
+system. The set of supported SQL commands depends on the RDMBS and
+database driver selected.
 
-<h2>Drivers</h2>  
+<h2>Database drivers</h2>  
 The list of available drivers can vary in various binary 
 distributions of GRASS. 
 <p>
@@ -44,16 +46,14 @@
 
 <tr><td><a href="grass-odbc.html">odbc</a></td><td>UnixODBC. (PostgreSQL, Oracle, etc.)</td>
 <td><a href="http://www.unixodbc.org/">http://www.unixodbc.org/</a></td></tr>
-
 </table>
 
-
 <h2>NOTES</h2>
 
 <ul>
 <li> SQL does not support '.' (dots) in table names.
-<li> Supported table name characters are only:<br>
-    [A-Za-z][A-Za-z0-9_]*
+<li> Supported table name characters are only: <br>
+<div class="code"><pre>[A-Za-z][A-Za-z0-9_]*</pre></div>
 <li> A table name must start with a character, not a number.
 <li> Text-string matching requires the text part to be 'single quoted'.
 When run from the command line multiple queries should be contained 
@@ -61,22 +61,31 @@
 <div class="code"><pre>
 d.vect map where="individual='juvenile' and area='beach'"
 </pre></div>
-<li> An error message such as "dbmi: Protocol error" either indicates an invalid column name
-     or an unsupported column type (then the GRASS SQL parser needs to be extended).
-<li> DBF column names are limited to 10 characters (DBF API definition)
+<li> An error message such as "<tt>dbmi: Protocol
+     error</tt>" either indicates an invalid column name or an
+     unsupported column type (then the GRASS SQL parser needs to be
+     extended).</li>
+<li> DBF column names are limited to 10 characters (DBF API definition).</li>
+<li> Attempts to use a reserved SQL word (depends on database backend) as 
+     column or table name will cause a "SQL syntax error".</li>
 </ul>
 
 
 <h2>EXAMPLES</h2>
 
-Display all vector points except for LAMAR valley and <i>extensive trapping</i> (brackets are superfluous in this example):
+Display all vector points except for <i>LAMAR</i> valley
+and <i>extensive trapping</i> (brackets are superfluous in this
+example):
+
 <div class="code"><pre>
 d.vect trapping_sites_points fcol=black icon=basic/diamond col=white size=13 \
     where="valley <> 'LAMAR' OR (valley = 'LAMAR' AND description = 'extensive trapping')"
 </pre></div>
 
 <p>
-Select all attributes from table where str1 column values are not 'No Name':
+Select all attributes from table where <i>str1</i> column values are not 'No
+Name':
+
 <div class="code"><pre>
 echo "SELECT * FROM archsites WHERE str1 <> 'No Name'" | db.select
 </pre></div>
@@ -162,6 +171,9 @@
 <h2>SEE ALSO</h2>
 
 <em>
+<a href="db.select.html">db.select</a>,
+<a href="db.execute.html">db.execute</a>,
+<a href="v.db.select.html">v.db.select</a>,
 <a href="v.db.update.html">v.db.update</a>
 </em>
 <p>
@@ -178,6 +190,6 @@
 <a href="index.html">Main index</a> -
 <a href="database.html">database index</a> -
 <a href="full_index.html">full index</a>
-<p>© 2008-2012 <a href="http://grass.osgeo.org">GRASS Development Team</a>
+<p>© 2008-2014 <a href="http://grass.osgeo.org">GRASS Development Team</a>
 </body>
 </html>



More information about the grass-commit mailing list