Changeset: 156097bad67d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=156097bad67d
Modified Files:
sql/backends/monet5/vaults/lidar/lidar.c
Branch: data-vaults
Log Message:
[LiDAR Vault]: Remove file extension from table name
The table name comes from the file name after the following
transformations:
1. Remove all the characters from the last occurence of the '.'
character to the end.
2. Change every remaining period ('.') character to an underscore
('_').
diffs (23 lines):
diff --git a/sql/backends/monet5/vaults/lidar/lidar.c
b/sql/backends/monet5/vaults/lidar/lidar.c
--- a/sql/backends/monet5/vaults/lidar/lidar.c
+++ b/sql/backends/monet5/vaults/lidar/lidar.c
@@ -704,8 +704,18 @@ str LIDARattach(Client cntxt, MalBlkPtr
if (s) *s = 0;
tname_low = toLower(bname);
+
+ /* Find the last dot in the filename and replace it with '\0' if
+ * it exists. This removes the extension part of the file, unless
+ * the extension part itself contains a dot character.
+ */
+ p = strrchr(tname_low, '.');
+ if (p != NULL) {
+ *p = '\0';
+ }
+
/* Sanitize table name by substituting dot characters ('.') for
underscores
- * ('_')
+ * ('_').
*/
while ((p = strchr(tname_low, '.')) != NULL) {
*p = '_';
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list