Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDBC select request doesn't store the first column in the variables #2205

Closed
asfimport opened this issue Mar 8, 2009 · 2 comments
Closed

Comments

@asfimport
Copy link
Collaborator

@milamberspace (Bug 46821):
In lastest svn (r747176).

When use a select request in JDBC sampler (with several column names), the first column aren't saved in JMeter variables.

Version: Nightly
Severity: major
OS: All

@asfimport
Copy link
Collaborator Author

@milamberspace (migrated from Bugzilla):
Created attachment proposal_patch_46821.txt: Proposal patch

proposal_patch_46821.txt
Index: /Workspaces-JMeter/Jmeter/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java
===================================================================
--- /Workspaces-JMeter/Jmeter/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java	(revision 751535)
+++ /Workspaces-JMeter/Jmeter/src/protocol/jdbc/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java	(working copy)
@@ -444,8 +444,8 @@
                 } else {
                     sb.append('\t');
                 }
-                if (jmvars != null && i < varnames.length) {
-                    String name = varnames[i].trim();
+                if (jmvars != null && i <= varnames.length) {
+                    String name = varnames[i - 1].trim();
                     if (name.length()>0){ // Save the value in the variable if present
                         jmvars.put(name+UNDERSCORE+j, o == null ? null : o.toString());
                     }

@asfimport
Copy link
Collaborator Author

Sebb (migrated from Bugzilla):
Good catch, thanks for the patch.

Fixed in r751560.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant