Issue 139 in migratordotnet: Inserting values with string formatting entries like "{0}" failes because of tracing not handling this.

2 views
Skip to first unread message

codesite...@google.com

unread,
Mar 8, 2010, 8:23:46 AM3/8/10
to migratordo...@googlegroups.com
Status: New
Owner: ----

New issue 139 by nezzdk: Inserting values with string formatting entries
like "{0}" failes because of tracing not handling this.
http://code.google.com/p/migratordotnet/issues/detail?id=139

Inserting values with string formatting with the Insert method failes when
the inserted values contains tags like {0} the Trace method expects some
formatting values.

What steps will reproduce the problem?
1. perform any insert with string values containing string formatting tags
like {0}.
you should get exceptions like this.

[migrate] Index (zero based) must be greater than or equal to zero and
less than the size of the argument list.
[migrate] at System.Text.StringBuilder.AppendFormat(IFormatProvider
provider, String format, Object[] args)
[migrate] at System.String.Format(IFormatProvider provider, String
format, Object[] args)
[migrate] at NAnt.Core.Task.Log(Level messageLevel, String message,
Object[] args)
[migrate] at Migrator.NAnt.Loggers.TaskLogger.Trace(String format,
Object[] args) in
c:\tmp\Oss\MigratorDotNet\migratordotnet\src\Migrator.NAnt\Loggers\TaskLogg
er.cs:line 127
[migrate] at Migrator.Providers.TransformationProvider.ExecuteNonQuery
(String sql) in
c:\tmp\Oss\MigratorDotNet\migratordotnet\src\Migrator.Providers\Transformat
ionProvider.cs:line 552


What is the expected output? What do you see instead?

I expect the value to be inserted and to see a message explaining that a
value was inserted.

you could do something like logger.Trace("{0}", new[]{sql});
in the ExecuteNonQuery method instead. by doing this you would keep the
SQL intact and wouldn't have to worry about values containing formatting.

What version of the product are you using? On what operating system? With
what .NET implementation/version?
Product Version: 0.9.0.10081

What database and version are you seeing this issue on?
doesn't matter it failes before hitting the DB.

Please provide any additional information below.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

Reply all
Reply to author
Forward
0 new messages