| 695 | } |
| 696 | |
| 697 | static cell_t SQL_GetError(IPluginContext *pContext, const cell_t *params) |
| 698 | { |
| 699 | IDatabase *db = NULL; |
| 700 | IPreparedQuery *stmt = NULL; |
| 701 | HandleError err; |
| 702 | |
| 703 | if ((err = ReadDbOrStmtHndl(params[1], pContext, &db, &stmt)) != HandleError_None) |
| 704 | { |
| 705 | return pContext->ThrowNativeError("Invalid statement or db Handle %x (error: %d)", params[1], err); |
| 706 | } |
| 707 | |
| 708 | const char *error = ""; |
| 709 | if (db) |
| 710 | { |
| 711 | error = db->GetError(); |
| 712 | } else if (stmt) { |
| 713 | error = stmt->GetError(); |
| 714 | } |
| 715 | |
| 716 | if (error[0] == '\0') |
| 717 | { |
| 718 | return false; |
| 719 | } |
| 720 | |
| 721 | pContext->StringToLocalUTF8(params[2], params[3], error, NULL); |
| 722 | |
| 723 | return 1; |
| 724 | } |
| 725 | |
| 726 | static cell_t SQL_QuoteString(IPluginContext *pContext, const cell_t *params) |
| 727 | { |
nothing calls this directly
no test coverage detected