Skip to content

Commit 77ea90b

Browse files
committed
Add documentation for OutParameterSentinelColumnName.
1 parent 7031e9f commit 77ea90b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/MySqlConnector/Core/SingleCommandPayloadCreator.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ internal sealed class SingleCommandPayloadCreator : ICommandPayloadCreator
1313
{
1414
public static ICommandPayloadCreator Instance { get; } = new SingleCommandPayloadCreator();
1515

16-
public static string OutParameterSentinelColumnName => "\uE001\b";
16+
// This is chosen to be something very unlikely to appear as a column name in a user's query. If a result set is read
17+
// with this as the first column name, the result set will be treated as 'out' parameters for the previous command.
18+
public static string OutParameterSentinelColumnName => "\uE001\b\x0B";
1719

1820
public bool WriteQueryCommand(ref CommandListPosition commandListPosition, IDictionary<string, CachedProcedure> cachedProcedures, ByteBufferWriter writer)
1921
{
@@ -166,7 +168,7 @@ private void WriteStoredProcedure(IMySqlCommand command, IDictionary<string, Cac
166168
commandText = inOutSetParameters + "CALL " + commandText;
167169
if (outParameters.Count > 0)
168170
{
169-
commandText += "SELECT '"+ OutParameterSentinelColumnName +"' AS '" + OutParameterSentinelColumnName + "', " + string.Join(", ", outParameterNames);
171+
commandText += "SELECT '" + OutParameterSentinelColumnName + "' AS '" + OutParameterSentinelColumnName + "', " + string.Join(", ", outParameterNames);
170172
}
171173
}
172174
else

0 commit comments

Comments
 (0)