| 812 | } |
| 813 | |
| 814 | static void |
| 815 | initializeUtf8ToServerConvProc(void) |
| 816 | { |
| 817 | int current_server_encoding; |
| 818 | |
| 819 | orafce_Utf8ToServerConvProc = NULL; |
| 820 | |
| 821 | /* |
| 822 | * Also look up the UTF8-to-server conversion function if needed. Since |
| 823 | * the server encoding is fixed within any one backend process, we don't |
| 824 | * have to do this more than once. |
| 825 | */ |
| 826 | current_server_encoding = GetDatabaseEncoding(); |
| 827 | if (current_server_encoding != PG_UTF8 && |
| 828 | current_server_encoding != PG_SQL_ASCII) |
| 829 | { |
| 830 | Oid utf8_to_server_proc; |
| 831 | |
| 832 | utf8_to_server_proc = |
| 833 | FindDefaultConversionProc(PG_UTF8, |
| 834 | current_server_encoding); |
| 835 | /* If there's no such conversion, just leave the pointer as NULL */ |
| 836 | if (OidIsValid(utf8_to_server_proc)) |
| 837 | { |
| 838 | FmgrInfo *finfo; |
| 839 | |
| 840 | finfo = (FmgrInfo *) MemoryContextAlloc(TopMemoryContext, |
| 841 | sizeof(FmgrInfo)); |
| 842 | fmgr_info_cxt(utf8_to_server_proc, finfo, |
| 843 | TopMemoryContext); |
| 844 | /* Set Utf8ToServerConvProc only after data is fully valid */ |
| 845 | orafce_Utf8ToServerConvProc = finfo; |
| 846 | } |
| 847 | } |
| 848 | } |
| 849 | |
| 850 | #endif |
| 851 |
no test coverage detected