Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • pike pike
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 104
    • Issues 104
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pikelang
  • pikepike
  • Issues
  • #4826
Closed
Open
Issue created May 08, 2009 by Peter Bortas@zinoOwner

New tds module does not handle bindings

Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=4826

Reported by Marcus Wellhardh wellhard@roxen.com

The new tds database module does not work with bindings.

Code, using "tds://test:test@burns/sparq" as connect string:

void test_char(Sql.Sql db)
{
  catch {
    db->query("DROP TABLE dbtest");
  };
  
  db->query("CREATE TABLE dbtest ("
	    "  ID            INT, "
	    "  MY_CHAR       CHAR(32) "
	    ")");
  
  db->query("INSERT INTO dbtest (ID, MY_CHAR) VALUES "
	    "(1, %s)", "abcdefghijklmnopqrstuvxyz");
}

Backtrace:

15: :BURNS:1 Line 1: Incorrect syntax near ':'.
/tmp/dbtest/roxen/server-5.0.352/pike/lib/pike/modules/Sql.pmod/tds.pike:186:
    Sql.tds()->tds_error("15: :BURNS:1 Line 1: Incorrect syntax near ':'.\n",1
    5,"","BURNS",1,"Line 1: Incorrect syntax near ':'.")                      
/tmp/dbtest/roxen/server-5.0.352/pike/lib/pike/modules/Sql.pmod/tds.pike:677:
    Sql.tds()->Connection()->process_msg(Sql.tds()->Connection()->InPacket(),1
    70)                                                                       
/tmp/dbtest/roxen/server-5.0.352/pike/lib/pike/modules/Sql.pmod/tds.pike:921:
    Sql.tds()->Connection()->process_default_tokens(@0=Sql.tds()->Connection()
    ->InPacket(),170)                                                         
/tmp/dbtest/roxen/server-5.0.352/pike/lib/pike/modules/Sql.pmod/tds.pike:1043:
    Sql.tds()->Connection()->process_result_tokens(@0)                        
/tmp/dbtest/roxen/server-5.0.352/pike/lib/pike/modules/Sql.pmod/tds.pike:1674:
    Sql.tds()->big_query()->create(Sql.tds()->compile_query())                
/tmp/dbtest/roxen/server-5.0.352/pike/lib/pike/modules/Sql.pmod/tds.pike:37:
    Sql.tds()->big_query()                                                    
/tmp/dbtest/roxen/server-5.0.352/pike/lib/pike/modules/Sql.pmod/Sql.pike:535:
    Sql.Sql()->query("INSERT INTO dbtest (ID, MY_CHAR) VALUES (2, :arg0)","abc
    defghijklmnopqrstuvxyz")                                                  
/home/wellhard/projects/dbtest/dbtest.pike:78: /main()->test_char(Sql.Sql())
/home/wellhard/projects/dbtest/dbtest.pike:411: /main()->main()
Assignee
Assign to
Time tracking