| 1754 | } |
| 1755 | |
| 1756 | static char * |
| 1757 | assignVariables(CState *st, char *sql) |
| 1758 | { |
| 1759 | char *p, |
| 1760 | *name, |
| 1761 | *val; |
| 1762 | |
| 1763 | p = sql; |
| 1764 | while ((p = strchr(p, ':')) != NULL) |
| 1765 | { |
| 1766 | int eaten; |
| 1767 | |
| 1768 | name = parseVariable(p, &eaten); |
| 1769 | if (name == NULL) |
| 1770 | { |
| 1771 | while (*p == ':') |
| 1772 | { |
| 1773 | p++; |
| 1774 | } |
| 1775 | continue; |
| 1776 | } |
| 1777 | |
| 1778 | val = getVariable(st, name); |
| 1779 | free(name); |
| 1780 | if (val == NULL) |
| 1781 | { |
| 1782 | p++; |
| 1783 | continue; |
| 1784 | } |
| 1785 | |
| 1786 | p = replaceVariable(&sql, p, eaten, val); |
| 1787 | } |
| 1788 | |
| 1789 | return sql; |
| 1790 | } |
| 1791 | |
| 1792 | static void |
| 1793 | getQueryParams(CState *st, const Command *command, const char **params) |
no test coverage detected