Fix comments and coding style.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 20 Jun 2018 04:57:40 +0000 (13:57 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 20 Jun 2018 04:58:57 +0000 (13:58 +0900)
pool_memqcache.c

index fe0c02cc17546c73da62a5e2316f09b1061ad5ea..4871b65e82bd130022bc27a8c5f09219b10fedf8 100644 (file)
@@ -637,7 +637,10 @@ bool pool_is_likely_select(char *query)
                while (*query && isspace(*query))
                        query++;
        }
-       if (! *query) { return false; }
+       if (! *query)
+       {
+               return false;
+       }
 
        /*
         * Get rid of head comment.
@@ -653,7 +656,10 @@ bool pool_is_likely_select(char *query)
                        query++;
                        do_continue = true;
                }
-               if (do_continue) { continue; }
+               if (do_continue)
+               {
+                       continue;
+               }
 
                while (*query && !strncmp(query, "\n", 2))
                {
@@ -838,8 +844,8 @@ bool pool_is_table_in_white_list(const char *table_name)
  * Extract table oid from INSERT/UPDATE/DELETE/TRUNCATE/
  * DROP TABLE/ALTER TABLE/COPY FROM statement.
  * Returns number of oids.
- * In case of error, returns 0(InvalidOid).
- * oids buffer(oidsp) will be discarded by subsequent call.
+ * In case of error, returns 0 (InvalidOid).
+ * oids buffer (oidsp) will be discarded by subsequent call.
  */
 int pool_extract_table_oids(Node *node, int **oidsp)
 {
@@ -1123,7 +1129,7 @@ static void pool_discard_dml_table_oid(void)
  * using same table oid will add to the same file. If the SELECT uses
  * multiple tables, multiple table_oid_file will be created. When
  * INSERT/UPDATE/DELETE is executed, corresponding caches must be
- * deleted(cache invalidation) (when DROP TABLE, ALTER TABLE is
+ * deleted (cache invalidation) (when DROP TABLE, ALTER TABLE is
  * executed, the caches must be deleted as well). When database is
  * dropped, all caches belonging to the database must be deleted.
  */
@@ -1203,7 +1209,7 @@ int pool_get_database_oid_from_dbname(char *dbname)
 }
 
 /*
- * Add cache id(shmem case) or hash key(memcached case) to table oid
+ * Add cache id (shmem case) or hash key (memcached case) to table oid
  * map file.  Caller must hold shmem lock before calling this function
  * to avoid file extension conflict among different pgpool child
  * process.
@@ -1385,7 +1391,7 @@ void pool_discard_oid_maps_by_db(int dboid)
 }
 
 /*
- * Reading cache id(shmem case) or hash key(memcached case) from table
+ * Read cache id (shmem case) or hash key (memcached case) from table
  * oid map file according to table_oids and discard cache entries.  If
  * unlink is true, the file will be unlinked after successful cache
  * removal.
@@ -1414,7 +1420,8 @@ static void pool_invalidate_query_cache(int num_table_oids, int *table_oid, bool
        /*
         * Create memqcache_oiddir/database_oid
         */
-       if (dboid == 0) {
+       if (dboid == 0)
+       {
                dboid = pool_get_database_oid();
 
                pool_debug("pool_invalidate_query_cache: dboid %d", dboid);