File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -1542,17 +1542,22 @@ mtm_make_table_local(PG_FUNCTION_ARGS)
1542
1542
rel = table_openrv (rv , RowExclusiveLock );
1543
1543
if (rel != NULL )
1544
1544
{
1545
- char * tableName = get_rel_name (reloid );
1545
+ char * table = get_rel_name (reloid );
1546
+ Name tableName = (Name ) palloc0 (NAMEDATALEN );
1546
1547
Oid schemaid = get_rel_namespace (reloid );
1547
- char * schemaName = get_namespace_name (schemaid );
1548
+ char * schema = get_namespace_name (schemaid );
1549
+ Name schemaName = (Name ) palloc0 (NAMEDATALEN );
1550
+
1551
+ strncpy (NameStr (* schemaName ), schema , NAMEDATALEN );
1552
+ strncpy (NameStr (* tableName ), table , NAMEDATALEN );
1548
1553
1549
1554
tupDesc = RelationGetDescr (rel );
1550
1555
1551
1556
/* Form a tuple. */
1552
1557
memset (nulls , false, sizeof (nulls ));
1553
1558
1554
- values [Anum_mtm_local_tables_rel_schema - 1 ] = CStringGetDatum (schemaName );
1555
- values [Anum_mtm_local_tables_rel_name - 1 ] = CStringGetDatum (tableName );
1559
+ values [Anum_mtm_local_tables_rel_schema - 1 ] = NameGetDatum (schemaName );
1560
+ values [Anum_mtm_local_tables_rel_name - 1 ] = NameGetDatum (tableName );
1556
1561
1557
1562
tup = heap_form_tuple (tupDesc , values , nulls );
1558
1563
You can’t perform that action at this time.
0 commit comments